Merge branch 'spidev' into 'master'

Mobile Integration,Pop Multiple Networks,DataTables responsible update,Migrations

See merge request fronk/thetool!155
This commit is contained in:
Frank Schubert
2024-01-09 15:30:03 +00:00
57 changed files with 76742 additions and 45594 deletions

View File

@@ -5,6 +5,7 @@
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<style>
.card-border {
border-left: 1px solid #428bca;
@@ -180,7 +181,7 @@ if ($devices->power != "0.0") {
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-5 card-border">
<div class="col-12 col-lg-5 card-border">
<div>
<h4>Allgemeine Informationen </h4>
@@ -262,7 +263,7 @@ if ($devices->power != "0.0") {
}
?>
<div class="col-4 card-border">
<div class="col-12 col-lg-4 card-border">
<div>
<h4><?= $StdHeader ?></h4>
</div>
@@ -325,7 +326,7 @@ if ($devices->power != "0.0") {
}
?>
</div>
<div class="col-3 card-border">
<div class="col-12 col-lg-3 card-border">
<div class="overflow-auto">
<h4 class="float-left">Config Backups</h4>
<?php if ($devices->devicetype->devicemanufactor->config_backup > count()): ?>
@@ -390,7 +391,7 @@ if ($devices->power != "0.0") {
<?php
if ($devices->devicetype->olt && TT_MBI_API_ENABLE) :
?>
<button id="olt-info-button" class="btn btn-success">OLT/ONT Infos</button>
<button id="olt-info-button" class="btn btn-success d-none d-lg-block">OLT/ONT Infos</button>
<div class="spinner-big text-info" style="display:none">
<i class="fas fa-spinner fa-spin spinner-ico font-24 "></i>
</div>
@@ -1062,8 +1063,10 @@ if ($devices->power != "0.0") {
var portid = button.closest('table').data('portid');
if (typeof customers[button.data('snr')] !== "undefined") {
customerid = customers[button.data('snr')]['customer_number'];
if (customers[button.data('snr')]['lastname'] != "") {
if (customers[button.data('snr')]['lastname'] != "" && customers[button.data('snr')]['lastname'] != null) {
customername = customerid + " / " + customers[button.data('snr')]['lastname'] + " " + customers[button.data('snr')]['firstname'];
} else if (customers[button.data('snr')]['lastname'] == null) {
customername = customers[button.data('snr')]['street'] + ", " + customers[button.data('snr')]['zip'] + " " + customers[button.data('snr')]['city'];
} else {
customername = customerid + " / " + customers[button.data('snr')]['company'] + " (C)";
}
@@ -1083,6 +1086,7 @@ if ($devices->power != "0.0") {
$('#ont-detail-refresh').data('portid', button.data('portid'));
$('#ont-detail-refresh').data('port', button.data('port'));
$('#ont-detail-refresh').data('ontid', button.data('ontid'));
$('#ont-detail-refresh').data('snr', button.data('snr'));
$('#ont-detail-mac-refresh').data('snr', button.data('snr'));
$('#ont-detail-mac-refresh').data('portid', button.data('portid'));
$('#ont-detail-mac-refresh').data('port', button.data('port'));
@@ -1179,8 +1183,10 @@ if ($devices->power != "0.0") {
var portid = button.closest('table').data('portid');
if (typeof customers[button.data('snr')] !== "undefined") {
customerid = customers[button.data('snr')]['customer_number'];
if (customers[button.data('snr')]['lastname'] != "") {
if (customers[button.data('snr')]['lastname'] != "" && customers[button.data('snr')]['lastname'] != null) {
customername = customerid + " / " + customers[button.data('snr')]['lastname'] + " " + customers[button.data('snr')]['firstname'];
} else if (customers[button.data('snr')]['lastname'] == null) {
customername = customers[button.data('snr')]['street'] + ", " + customers[button.data('snr')]['zip'] + " " + customers[button.data('snr')]['city'];
} else {
customername = customerid + " / " + customers[button.data('snr')]['company'] + " (C)";
}

View File

@@ -1,4 +1,6 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<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"/>
<?php
foreach ($devicetypes as $devicetype) {
$deviceTypes[$devicetype->id] = $devicetype->devicemanufactor->name . " " . $devicetype->name;
@@ -21,8 +23,11 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "device-detail") {
$cancelUrl = self::getUrl("Device");
}
?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
<div class="col-12">

View File

@@ -7,9 +7,8 @@ $pagination_entity_name = "Device";
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<style>
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: 1.5rem;
}
</style>
<!-- start page title -->
<div class="row">
@@ -36,20 +35,21 @@ $pagination_entity_name = "Device";
<div class="float-left">
<h4 class="header-title">Liste aller Devices</h4>
</div>
<div class="float-right">
<div class="float-right ">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Device", "add") ?>"><i
class="fas fa-plus"></i> Neues Device anlegen</a>
class="fas fa-plus"></i><span
class="d-none d-lg-inline"> Neues Device anlegen</span></a>
</div>
</div>
</div>
<table id="datatable" class="table table-striped table-hover table-sm font-13">
<thead>
<tr>
<th style="min-width: 250px;">Device Name</th>
<th class="text-center">Geräte Typ</th>
<th class="text-center">Hersteller</th>
<th class="text-center">Pop/Adresse</th>
<th class="text-center">IP-Adresse</th>
<th class="all">Device Name</th>
<th class="text-center ">Geräte Typ</th>
<th class="text-center ">Hersteller</th>
<th class="text-center ">Pop/Adresse</th>
<th class="text-center all">IP-Adresse</th>
<th class="text-center">Mac-Adresse</th>
<th class="text-center">Seriennummer</th>
<th class="text-center">Preis</th>
@@ -112,8 +112,9 @@ $pagination_entity_name = "Device";
?>
<tr>
<td>
<a href="<?= self::getUrl("Device", "Detail", ["id" => $device->id]) ?>"><?= $device->name ?></a>
<td class="text-nowrap">
<a class=" text-nowrap"
href="<?= self::getUrl("Device", "Detail", ["id" => $device->id]) ?>"><?= $device->name ?></a>
</td>
<td class="text-center"><?= $device->devicetype->name ?></td>
<td class="text-center"><?= $device->devicetype->devicemanufactor->name ?></td>

View File

@@ -1,4 +1,6 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<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"/>
<!-- start page title -->
<div class="row">
<div class="col-12">

View File

@@ -31,7 +31,8 @@ $pagination_entity_name = "Devicemanufactor";
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Devicemanufactor", "add") ?>"><i
class="fas fa-plus"></i> Neuen Gerätehersteller anlegen</a>
class="fas fa-plus"></i><span
class="d-none d-lg-inline"> Neuen Gerätehersteller anlegen</span></a>
</div>
</div>
</div>
@@ -56,8 +57,8 @@ $pagination_entity_name = "Devicemanufactor";
<?php foreach ($devicemanufactors as $devicemanufactor): ?>
<tr>
<td><?= $devicemanufactor->name ?></td>
<td><?= $devicemanufactor->creator->name ?>
<td class="text-nowrap"><?= $devicemanufactor->name ?></td>
<td class="text-nowrap"><?= $devicemanufactor->creator->name ?>
(<?= date("d.m.Y , H:i", $devicemanufactor->create) ?>)
</td>

View File

@@ -1,5 +1,6 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<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"/>
<!-- start page title -->
<div class="row">
<div class="col-12">

View File

@@ -4,7 +4,8 @@ $pagination_baseurl_params = ["filter" => $filter];
$pagination_entity_name = "Devicetype";
?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?=self::getResourcePath()?>assets/css/datatables-std.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
<div class="col-12">
@@ -32,14 +33,11 @@ $pagination_entity_name = "Devicetype";
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Devicetype", "add") ?>"><i
class="fas fa-plus"></i> Neuen Gerätetyp anlegen</a>
class="fas fa-plus"></i><span
class="d-none d-lg-inline"> Neuen Gerätetyp anlegen</span></a>
</div>
</div>
</div>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<table id="datatable" class="table table-striped table-hover table-sm">
<thead>
<tr>
@@ -65,7 +63,7 @@ $pagination_entity_name = "Devicetype";
<?php foreach ($devicetypes as $devicetype): ?>
<tr>
<td><?= $devicetype->name ?></td>
<td class="text-nowrap"><?= $devicetype->name ?></td>
<td class="text-center"><?= $devicetype->devicemanufactor->name ?></td>
<td class="text-right"><?= $devicetype->price ?> €</td>
@@ -98,15 +96,15 @@ $pagination_entity_name = "Devicetype";
</div>
<script type="text/javascript">
var hidesearch=[5];
var hidesearch = [5];
$(document).ready(function () {
});
</script>
<script type="text/javascript" src="<?=self::getResourcePath()?>assets/js/datatables-std.js?<?=date('U')?>"></script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -106,13 +106,13 @@
<th></th>
</tr>
<?php foreach($network->pops as $pop): ?>
<tr>
<td><?=$pop->name?></td>
<td><?=$pop->gps_lat?>, <?=$pop->gps_long?></td>
<td><?=nl2br($pop->location)?></td>
<tr>
<td><?=$pop->pop->name?></td>
<td><?=$pop->pop->gps_lat?>, <?=$pop->pop->gps_long?></td>
<td><?=nl2br($pop->pop->location)?></td>
<td class="controls" style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Pop", "edit", ["id" => $pop->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Pop", "delete", ["id" => $pop->id])?>" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
<a href="<?=self::getUrl("Pop", "edit", ["id" => $pop->pop->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Pop", "delete", ["id" => $pop->pop->id])?>" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>

View File

@@ -1,5 +1,5 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css" rel="stylesheet" type="text/css"/>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet" type="text/css"/>
<style>
.card-border {
@@ -134,18 +134,18 @@ $plugs[3] = "E2000";
$vlans = "";
if (!empty(trim($pops->vlan_public)))
$vlans .= '<span class="order-date-pill active mb-0">Public: <span class="font-weight-500">' . $pops->vlan_public . '</span class="font-weight-500"></span>';
$vlans .= '<span class="order-date-pill active mb-0 d-inline-block d-lg-inline">Public: <span class="font-weight-500">' . $pops->vlan_public . '</span class="font-weight-500"></span>';
if (!empty(trim($pops->vlan_nat)))
$vlans .= '<span class="order-date-pill active mb-0">Nat: <span class="font-weight-500">' . $pops->vlan_nat . '</span></span>';
$vlans .= '<span class="order-date-pill active mb-0 d-inline-block d-lg-inline">Nat: <span class="font-weight-500">' . $pops->vlan_nat . '</span></span>';
if (!empty(trim($pops->vlan_ipv6)))
$vlans .= '<span class="order-date-pill active mb-0">IPv6: <span class="font-weight-500">' . $pops->vlan_ipv6 . '</span></span>';
$vlans .= '<span class="order-date-pill active mb-0 d-inline-block d-lg-inline">IPv6: <span class="font-weight-500">' . $pops->vlan_ipv6 . '</span></span>';
?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-5 card-border">
<div class="col-12 col-lg-5 card-border">
<div>
<h4>Allgemeine Informationen </h4>
@@ -154,8 +154,8 @@ if (!empty(trim($pops->vlan_ipv6)))
<table class="table table-sm">
<tbody>
<tr>
<th style="min-width: 250px; width: 300px;">Netzgebiet</th>
<td><?= $pops->network->name ?> </td>
<th class="w-30">Netzgebiet</th>
<td><?= $popnetwork ?> </td>
</tr>
<tr>
<th>Name</th>
@@ -171,15 +171,15 @@ if (!empty(trim($pops->vlan_ipv6)))
, <?= rtrim($pops->gps_long, 0) ?></a></td>
</tr>
<tr>
<th>Standort Info</th>
<th class="text-nowrap">Standort Info</th>
<td><?= nl2br($pops->location) ?> </td>
</tr>
<tr>
<th>Access VLANs</th>
<th class="text-nowrap">Access VLANs</th>
<td><?= $vlans ?> </td>
</tr>
<tr>
<th>Interne Notiz</th>
<th class="text-nowrap">Interne Notiz</th>
<td><?= nl2br($pops->note) ?> </td>
</tr>
@@ -189,7 +189,7 @@ if (!empty(trim($pops->vlan_ipv6)))
</div>
<div class="col-7 card-border">
<div class="col-12 col-lg-7 card-border">
<div>
<h4>Pop Devices</h4>
</div>
@@ -197,18 +197,18 @@ if (!empty(trim($pops->vlan_ipv6)))
if (!empty($devices)) {
?>
<div>
<table id="datatable" class="table table-striped table-hover">
<table id="datatable" class="table table-striped table-hover" style="width: 100%">
<thead>
<tr>
<th>Geräte Name</th>
<th class="text-center">Geräte Typ</th>
<th class="text-center">Hersteller</th>
<th class="text-center">IP-Adresse</th>
<th class="text-center">Seriennummer</th>
<th class="text-center">Preis</th>
<th class="all">Geräte Name</th>
<th class="text-center ">Geräte Typ</th>
<th class="text-center ">Hersteller</th>
<th class="text-center all">IP-Adresse</th>
<th class="text-center " >Seriennummer</th>
<th class="text-center ">Preis</th>
<th title="maximale Leistung" class="text-center text-nowrap">max. P.</th>
</tr>
<tr id="filterrow">
<tr id="filterrow" class="d-none d-lg-table-row">
<th></th>
<th></th>
<th></th>
@@ -309,6 +309,15 @@ if (!empty(trim($pops->vlan_ipv6)))
</div>
</div>
<?php if ($popracks) : ?>
<div class="modal fade bd-example-modal-xl" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
...
</div>
</div>
</div>
<div class="modal fade " id="rackModuleModal" tabindex="-1" role="dialog" aria-labelledby="rackModuleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
@@ -498,7 +507,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$extTextspan = "";
foreach ($module['slots'] as $slots) {
$extText = "";
$title=$slots['modulname'];
$title = $slots['modulname'];
if ($slots['type'] == '0') {
$color = '#9fff6e';
$colorclass = "rack-color-lwl";
@@ -507,7 +516,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$extTextspan = "<span style='font-size: 12px;font-weight: 400'>" . $extText . "</span>";
}
} else if ($slots['type'] == '1') {
$slots['modulname']='<a style="color: #000000;text-decoration: underline;" target="_self" href="'.self::getUrl("Device", "detail", ["id" => $slots['device_id']]).'">'.$slots['modulname'].'</a>';
$slots['modulname'] = '<a style="color: #000000;text-decoration: underline;" target="_self" href="' . self::getUrl("Device", "detail", ["id" => $slots['device_id']]) . '">' . $slots['modulname'] . '</a>';
?>
<script>
$("#module-device-id option[value='<?= $slots['device_id'] ?>']").remove();
@@ -605,542 +614,17 @@ if (!empty(trim($pops->vlan_ipv6)))
<script type="text/javascript" src="<?= self::getResourcePath() ?>assets/js/Sortable.js"></script>
<script type="text/javascript">
var hidesearch = [5, 6];
var trigger;
$(document).ready(function () {
if ($('#sortracklist').length > 0) {
Sortable.create(sortracklist, {
handle: '.move-handle',
onEnd: function () {
var popid = $('#sortracklist').data('popid');
var racksortids = [];
$('#sortracklist').find('th').each(function (index, value) {
racksortids.push($(this).data('rackid'));
});
$.post("<?= self::getUrl("Poprack", "api", ['do' => 'sortRack']) ?>&pop_id=" + popid, {
racksortids: racksortids
}, function (data) {
if (data.success === true) {
}
}, "json");
}
});
}
$('#pop-rack-div').show();
$('#rackModal').on('show.bs.modal', function (event) {
var thisclick = $(event.relatedTarget);
var rackhe = thisclick.closest('table').find('th').data('rackhe');
var rackid = thisclick.closest('table').find('th').data('rackid');
var rackname = $.trim(thisclick.closest('table').find('th').text());
var minhe = 1;
var modal = $(this);
var edit = 0;
modal.find('.alert').text('');
modal.find('.alert').hide();
if (rackid === undefined) {
$('#rack-name').val('');
$('#rack-he').val('');
var popid = thisclick.data('popid');
$('#rack-add').data('popid', popid);
$('#rack-update').hide();
$('#rack-remove').hide();
$('#rack-add').show();
} else {
edit = 1;
$('#rack-remove').hide();
$('#rack-add').hide();
$('#rack-update').show();
$('#rack-he').val(rackhe);
$('#rack-name').val(rackname);
for (let i = 1; i <= rackhe; i++) {
if (!thisclick.closest('table').find('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
minhe = i;
}
}
if (minhe === 1) {
$('#rack-remove').data('rackid', rackid);
$('#rack-remove').show();
}
$('#rack-update').data('rackid', rackid);
$('#rack-update').data('rackminhe', minhe);
}
}
)
;
$('#rackModuleModal').on('show.bs.modal', function (event) {
trigger = $(event.relatedTarget);
var destinationname = trigger.closest('table').find('th').text();
var rackhe = trigger.closest('table').find('th').data('rackhe');
var modal = $(this);
modal.find('.modal-title').html('<span id="module-info">Modul (' + destinationname + ')</span>');
modal.find('.alert').text('');
modal.find('.alert').hide();
var options;
var selected;
var hemaxcount = 1;
var hemaxcountactive = 1;
var edit = 0;
var parent = trigger.closest('tr');
if (trigger.closest('tr').find('td').eq(1).html() === undefined) {
edit = 1;
parent = trigger.closest('tr').prev();
for (let i = 1; i <= rackhe; i++) {
if (parent.find('td').eq(1).html() !== undefined) {
break;
} else {
parent = parent.prev();
}
}
}
if (parent.find('td').eq(1).data('id') || parent.find('td').eq(2).data('id') || parent.find('td').eq(3).data('id') || parent.find('td').eq(4).data('id')) {
var counttd = parent.find('td').length - 1;
var newmodule = false;
if (counttd > 1) {
var options;
for (let i = 1; i <= counttd; i++) {
options = options + '<option value="' + i + '">' + i + '</option>';
}
$('#module-slot').html(options);
$('#module-position').html(options);
$('#module-slot-div').show();
}
$('#module-width').attr('disabled', 'disabled');
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control" disabled="disabled"><option value="` + parent.find('td').eq(1).attr('rowspan') + `">` + parent.find('td').eq(1).attr('rowspan') + `</option><select>`);
$('#he-start-div').html(`<select required="required" id="module-he-start" name="module-he-start" class="form-control" disabled="disabled"><option value="` + parent.find('td').eq(0).data('he') + `">` + parent.find('td').eq(0).data('he') + `</option></select>`);
if (parent.find('td').eq(1).data('id') === undefined) {
newmodule = true;
}
var modwidth = 12 / counttd;
$('#module-width').val(modwidth);
if (!newmodule) {
$('#module-remove').show();
$('#module-update').show();
$('#module-add').hide();
$('#module-type').val(parent.find('td').eq(1).data('type')).change();
if ($('#module-type').val() == "1") {
$('#module-device-id').hide();
$('#module-device-text').text(parent.find('td').eq(1).data('name'));
$('#module-device-text').show();
}
if (parent.find('td').eq(1).data('ports') != "") {
$('#module-ports').val(parent.find('td').eq(1).data('ports')).change();
$('#module-plug').val(parent.find('td').eq(1).data('plug'));
}
$('#module-type').attr('disabled', 'disabled');
$('#module-name').val(parent.find('td').eq(1).data('name'));
// $('#module-name').attr('disabled', 'disabled');
$('#module-remove').data('moduleid', parent.find('td').eq(1).data('id'));
$('#module-update').data('moduleid', parent.find('td').eq(1).data('id'));
} else {
$('#module-remove').hide();
$('#module-update').hide();
$('#module-add').show();
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').show();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-type').val('0').change();
$('#module-type').removeAttr('disabled');
$('#module-plug').removeAttr('disabled');
$('#module-ports').removeAttr('disabled');
$('#module-name').val('');
$('#module-ports').val('48');
$('#module-ports').trigger("change");
$('#module-position-div').hide();
$('#module-update').hide();
$('#module-device-text').hide();
}
} else {
$('#module-remove').hide();
$('#module-update').hide();
$('#module-add').show();
for (let i = 1; i <= rackhe; i++) {
if (i == trigger.data('he')) {
selected = 'selected="selected"';
} else {
selected = '';
}
if (trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
options = options + '<option ' + selected + ' value="' + i + '">' + i + '</option>';
}
if (hemaxcountactive == 1 && i > trigger.data('he') && !trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcountactive = 0;
}
if (hemaxcountactive == 1 && i > trigger.data('he') && trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcount++;
}
}
$('#he-start-div').html(`<select required="required" id="module-he-start" name="module-he-start" class="form-control">` + options + `</select>`);
options = "";
selected = "";
for (let i = 1; i <= hemaxcount; i++) {
options = options + '<option ' + selected + ' value="' + i + '">' + i + '</option>';
}
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control">` + options + `</select>`);
if (edit == 0) {
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-type').val('0').change();
$('#module-type').removeAttr('disabled');
$('#module-width').removeAttr('disabled');
$('#module-plug').removeAttr('disabled');
$('#module-ports').removeAttr('disabled');
$('#module-name').val('');
$('#module-width').val('12');
$('#module-ports').val('48');
$('#module-ports').trigger("change");
$('#module-position').empty();
$('#module-position-div').hide();
$('#module-device-text').hide();
$('#module-device-id').show();
}
}
});
$("body").on("change", "#module-type", function () {
if (parseInt($(this).val()) === 1) {
$('#module-name-div').hide();
$('#module-name').attr('disabled', 'disabled');
$('#module-device-div').show();
$('#module-device-id').removeAttr('disabled');
$('#module-ports-div').hide();
$('#module-plug-div').hide();
} else if (parseInt($(this).val()) === 0) {
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-ports-div').show();
$('#module-plug-div').show();
} else {
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-ports-div').hide();
$('#module-plug-div').hide();
}
});
$("body").on("change", "#module-he-start", function () {
var rackhe = trigger.closest('table').find('th').data('rackhe');
var hemaxcount = 1;
var hemaxcountactive = 1
var options;
var selected;
for (let i = 1; i <= rackhe; i++) {
if (hemaxcountactive == 1 && i > $(this).val() && !trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcountactive = 0;
}
if (hemaxcountactive == 1 && i > $(this).val() && trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcount++;
}
}
for (let i = 1; i <= hemaxcount; i++) {
options = options + '<option ' + selected + ' value="' + i + '">' + i + '</option>';
}
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control">` + options + `</select>`);
});
$("body").on("click", "#module-add", function () {
var error;
var rackid = trigger.closest('table').find('th').data('rackid');
var endhe = parseInt($.trim($('#module-he-start').val())) + parseInt($.trim($('#module-he-count').val())) - 1;
if (!$.trim($('#module-name').val()) && $.trim($('#module-type').val()) != "1") {
error = "Modul Name darf nicht leer sein";
}
if ($.trim($('#module-type').val()) == "1" && !$.trim($('#module-device-id').val())) {
error = "Kein Device ausgewählt";
}
if (!error) {
$.post("<?= self::getUrl("Poprackmodule", "api", ['do' => 'addModule']) ?>&poprack_id=" + rackid, {
type: $.trim($('#module-type').val()),
device_id: $.trim($('#module-device-id').val()),
name: $.trim($('#module-name').val()),
start_he: $.trim($('#module-he-start').val()),
end_he: endhe,
ports: $.trim($('#module-ports').val()),
plug: $.trim($('#module-plug').val()),
width: $.trim($('#module-width').val()),
position: $.trim($('#module-position').val())
}, function (data) {
if (data.success === true) {
$('#rackModuleModal').modal('toggle');
$.get("<?= self::getUrl("Poprack", "api", ['do' => 'generateRack']) ?>&id=" + rackid, function (data, status) {
trigger.closest('tbody').html(data);
});
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#module-remove", function () {
var moduleid = $(this).data('moduleid');
var rackid = trigger.closest('table').find('th').data('rackid');
if (confirm("Modul entfernen?")) {
$.post("<?= self::getUrl("Poprackmodule", "api", ['do' => 'removeModule']) ?>", {
id: moduleid
}, function (data) {
if (data.success === true) {
$('#rackModuleModal').modal('toggle');
$.get("<?= self::getUrl("Poprack", "api", ['do' => 'generateRack']) ?>&id=" + rackid, function (data, status) {
trigger.closest('tbody').html(data);
});
}
}, "json");
}
});
$("body").on("click", "#module-update", function () {
var moduleid = $(this).data('moduleid');
var rackid = trigger.closest('table').find('th').data('rackid');
var error;
if (!$.trim($('#module-name').val())) {
error = "Modul Name darf nicht leer sein";
}
if (!error) {
$.post("<?= self::getUrl("Poprackmodule", "api", ['do' => 'updateModule']) ?>", {
id: moduleid,
name: $.trim($('#module-name').val()),
ports: $.trim($('#module-ports').val()),
plug: $.trim($('#module-plug').val())
}, function (data) {
if (data.success === true) {
$('#rackModuleModal').modal('toggle');
$.get("<?= self::getUrl("Poprack", "api", ['do' => 'generateRack']) ?>&id=" + rackid, function (data, status) {
trigger.closest('tbody').html(data);
});
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#rack-update", function () {
var rackid = $(this).data('rackid');
var rackmin = $(this).data('rackminhe');
var error;
if ($('#rack-he').val() < rackmin) {
error = "Minimale Höheneinheiten: " + rackmin;
}
if ($('#rack-he').val() > 60) {
error = "Maximale Höheneinheiten: 60";
}
if (!$.isNumeric($('#rack-he').val())) {
error = "Bitte Zahl bei Höheneinheiten eingeben";
}
if (!$.trim($('#rack-he').val())) {
error = "Höheneinheiten darf nicht leer sein";
}
if (!$.trim($('#rack-name').val())) {
error = "Schrank Name darf nicht leer sein";
}
if (!error) {
$.post("<?= self::getUrl("Poprack", "api", ['do' => 'editRack']) ?>&poprack_id=" + rackid, {
name: $.trim($('#rack-name').val()),
he: $.trim($('#rack-he').val())
}, function (data) {
if (data.success === true) {
$('#rackModal').modal('toggle');
location.reload();
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#rack-add", function () {
var popid = $(this).data('popid');
var error;
if ($('#rack-he').val() < 1) {
error = "Minimale Höheneinheiten: " + 1;
}
if ($('#rack-he').val() > 60) {
error = error = "Maximale Höheneinheiten: 60";
}
if (!$.isNumeric($('#rack-he').val())) {
error = "Bitte Zahl bei Höheneinheiten eingeben";
}
if (!$.trim($('#rack-he').val())) {
error = "Höheneinheiten darf nicht leer sein";
}
if (!$.trim($('#rack-name').val())) {
error = "Schrank Name darf nicht leer sein";
}
if (!error) {
$.post("<?= self::getUrl("Poprack", "api", ['do' => 'addRack']) ?>&pop_id=" + popid, {
name: $.trim($('#rack-name').val()),
he: $.trim($('#rack-he').val())
}, function (data) {
if (data.success === true) {
$('#rackModal').modal('toggle');
location.reload();
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#rack-remove", function () {
var rackid = $(this).data('rackid');
$.post("<?= self::getUrl("Poprack", "api", ['do' => 'removeRack']) ?>", {
id: rackid
}, function (data) {
if (data.success === true) {
$('#rackModal').modal('toggle');
location.reload();
}
}, "json");
});
$("body").on("change", "#module-width", function () {
if ($(this).val() == "12") {
$('#module-position-div').hide();
} else if ($(this).val() == "6") {
$('#module-position').html(`<option value="1">1</option>
<option value="2">2</option>
`);
$('#module-position-div').show();
} else if ($(this).val() == "4") {
$('#module-position').html(`<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
`);
$('#module-position-div').show();
} else if ($(this).val() == "3") {
$('#module-position').html(`<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
`);
$('#module-position-div').show();
}
});
$("body").on("change", "#module-ports", function () {
var plugs = [];
if ($(this).find(':selected').data('plugs') !== undefined) {
plugs = $(this).find(':selected').data('plugs').split(';');
$("#module-plug option").each(function () {
if (plugs.includes($(this).val())) {
$(this).show();
} else {
if ($(this).val() == $('#module-plug').val()) {
$('#module-plug').val(plugs[0]);
}
$(this).hide();
}
});
}
});
$("body").on("change", "#module-slot", function () {
$('#module-position').val($(this).val());
var parent = trigger.closest('tr');
if (trigger.closest('tr').find('td').eq(1).html() === undefined) {
parent = trigger.closest('tr').prev();
for (let i = 1; i <= rackhe; i++) {
if (parent.find('td').eq(1).html() !== undefined) {
break;
} else {
parent = parent.prev();
}
}
}
var newmodule = false;
var tdnumber = parseInt($(this).val())
if (parent.find('td').eq(tdnumber).data('id') === undefined) {
newmodule = true;
}
if (!newmodule) {
$('#module-remove').show();
$('#module-update').show();
$('#module-add').hide();
$('#module-type').val(parent.find('td').eq(tdnumber).data('type')).change();
if ($('#module-type').val() == "1") {
$('#module-device-id').hide();
$('#module-device-text').text(parent.find('td').eq(tdnumber).data('name'));
$('#module-device-text').show();
}
if (parent.find('td').eq(tdnumber).data('ports') != "") {
$('#module-ports').val(parent.find('td').eq(tdnumber).data('ports')).change();
$('#module-plug').val(parent.find('td').eq(tdnumber).data('plug'));
}
$('#module-type').attr('disabled', 'disabled');
$('#module-name').val(parent.find('td').eq(tdnumber).data('name'));
// $('#module-name').attr('disabled', 'disabled');
$('#module-remove').data('moduleid', parent.find('td').eq(tdnumber).data('id'));
$('#module-update').data('moduleid', parent.find('td').eq(tdnumber).data('id'));
} else {
$('#module-remove').hide();
$('#module-update').hide();
$('#module-add').show();
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').show();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-type').val('0').change();
$('#module-type').removeAttr('disabled');
$('#module-plug').removeAttr('disabled');
$('#module-ports').removeAttr('disabled');
$('#module-name').val('');
$('#module-ports').val('48');
$('#module-ports').trigger("change");
$('#module-position-div').hide();
$('#module-update').hide();
$('#module-device-text').hide();
}
});
});
let trigger;
let linkSorTracklist = "<?= self::getUrl("Poprack", "api", ['do' => 'sortRack']) ?>";
let linkAddModule = "<?= self::getUrl("Poprackmodule", "api", ['do' => 'addModule']) ?>";
let linkRemoveModule = "<?= self::getUrl("Poprackmodule", "api", ['do' => 'removeModule']) ?>";
let linkGenerateRack = "<?= self::getUrl("Poprack", "api", ['do' => 'generateRack']) ?>";
let linkUpdateModule = "<?= self::getUrl("Poprackmodule", "api", ['do' => 'updateModule']) ?>";
let linkEditRack = "<?= self::getUrl("Poprack", "api", ['do' => 'editRack']) ?>";
let linkAddRack = "<?= self::getUrl("Poprack", "api", ['do' => 'addRack']) ?>";
let linkRemoveRack = "<?= self::getUrl("Poprack", "api", ['do' => 'removeRack']) ?>";
</script>
<script type="text/javascript" src="<?= self::getResourcePath() ?>js/pages/pop/detail.js"></script>
<script type="text/javascript" src="<?= self::getResourcePath() ?>assets/js/datatables-std.js"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -2,17 +2,16 @@
if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") {
$cancelUrl = self::getUrl("Pop", "Detail", ["id" => $pop->id]);
$cancelText="Pop Detail";
$cancelText = "Pop Detail";
} else if (isset($_GET['returnto'])) {
$cancelUrl = self::getUrl("Pop");
$cancelText="Pops";
} else
{
$cancelText = "Pops";
} else {
$cancelUrl = self::getUrl("Network");
}
?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
<div class="col-12">
@@ -31,7 +30,7 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") {
<li class="breadcrumb-item"><a
href="<?= $cancelUrl ?>"><?= ucfirst($cancelText) ?>
</a></li>
</a></li>
<?php
}
?>
@@ -62,10 +61,11 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") {
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="network_id">Netzgebiet</label>
<div class="col-lg-10">
<select class="select2 form-control " name="network_id" id="owner_id">
<select class="select2 form-control " multiple="multiple" name="network_id[]"
id="owner_id">
<option></option>
<?php foreach ($networks as $network): ?>
<option value="<?= $network->id ?>" <?= ($pop->network_id == $network->id) ? "selected='selected'" : "" ?>><?= ($network->name) ?></option>
<option value="<?= $network->id ?>" <?= (in_array($network->id, $popnetwork)) ? "selected='selected'" : "" ?>><?= ($network->name) ?></option>
<?php endforeach; ?>
</select>
</div>
@@ -183,6 +183,7 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") {
$('form').on('blur', 'input[type=number]', function (e) {
$(this).off('wheel.disableScroll')
});
$(".select2").select2();
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -4,7 +4,8 @@ $pagination_baseurl_params = ["filter" => $filter];
$pagination_entity_name = "Pops";
?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css" rel="stylesheet" type="text/css"/>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
<div class="col-12">
@@ -32,16 +33,12 @@ $pagination_entity_name = "Pops";
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Pop", "add", ['returnto' => "pop"]) ?>"><i
class="fas fa-plus"></i> Neuen Pop anlegen</a>
class="fas fa-plus"></i><span
class="d-none d-lg-inline"> Neuen Pop anlegen</span></a>
</div>
</div>
</div>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<table id="datatable" class="table table-striped table-hover table-sm font-13">
<table id="datatable" class="table table-striped table-hover table-sm font-13" style="width: 100%">
<thead>
<tr>
<th>Name</th>
@@ -75,9 +72,10 @@ $pagination_entity_name = "Pops";
?>
<tr>
<td><a href="<?= self::getUrl("Pop", "Detail", ["id" => $pop->id]) ?>"><?= $pop->name ?></a>
<td class="text-nowrap"><a
href="<?= self::getUrl("Pop", "Detail", ["id" => $pop->id]) ?>"><?= $pop->name ?></a>
</td>
<td><?= $pop->network->name ?></td>
<td><?= $pop->networks ?></td>
<td><?= $pop->location ?></td>
<td class="text-center"><?= trim($vlans) ?></td>
<td class="text-center"><a
@@ -109,7 +107,7 @@ $pagination_entity_name = "Pops";
</div>
</div>
<script src="https://cdn.datatables.net/responsive/2.5.0/js/dataTables.responsive.min.js"></script>
<script type="text/javascript">
function toggleBuilding(id) {

View File

@@ -0,0 +1,336 @@
<?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"); ?>

View File

@@ -0,0 +1,117 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<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"/>
<!-- 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"><a
href="<?= self::getUrl("TimerecordingCategory") ?>">Zeiterfassung
Buchungsarten</a>
</li>
<li class="breadcrumb-item active"><?= ($timerecordingcategoriess->id) ? "bearbeiten" : "Neu" ?></li>
</ol>
</div>
<h4 class="page-title"><?= ($timerecordingcategoriess->id) ? "Zeiterfassung Buchungsart bearbeiten" : "Neue Zeiterfassung Buchungsart" ?></h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h4 class="header-title mb-2"><?= ($timerecordingcategoriess->id) ? "Zeiterfassung Buchungsart bearbeiten" : "Neue Zeiterfassung Buchungsart" ?></h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("TimerecordingCategory", "save") ?>">
<div class="card">
<div class="card-body">
<input type="hidden" name="id" value="<?= $timerecordingcategoriess->id ?>"/>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="name">Beizeichnung</label>
<div class="col-lg-3">
<input type="text" id="name" name="name" class="form-control"
value="<?= $timerecordingcategoriess->name ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="short">BMD KZ</label>
<div class="col-lg-2">
<input type="text" id="short" name="short" class="form-control"
value="<?= $timerecordingcategoriess->short ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="hourday">Buchungszeitraum</label>
<div class="col-lg-2">
<select id="hourday" name="hourday" class="select2 form-control">
<?php foreach ($timerecordingcategorieshourday as $key => $value) : ?>
<option value="<?= $key ?>" <?= ($key == $timerecordingcategoriess->hourday) ? "selected='selected'" : "" ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="approval">Genehmigungspflichtig</label>
<div class="col-lg-3">
<div class="form-check">
<input class="form-check-input" <?php if ($timerecordingcategoriess->approval) echo 'checked="checked"'; ?>
type="checkbox" name="approval" value="1" id="olt">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="require_comment">Anmerkung
Pflichtfeld</label>
<div class="col-lg-3">
<div class="form-check">
<input class="form-check-input" <?php if ($timerecordingcategoriess->require_comment) echo 'checked="checked"'; ?>
type="checkbox" name="require_comment" value="1" id="olt">
</div>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2"></label>
<div class="col-lg-10">
<button type="submit" class="btn btn-primary">Speichern</button>
<a href="<?= self::getUrl("TimerecordingCategory") ?>">
<button type="button" class="btn btn-secondary">Abbrechen</button>
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(".select2").select2({placeholder: ""});
// disable mousewheel on a input number field when in focus
$('form').on('focus', 'input[type=number]', function (e) {
$(this).on('wheel.disableScroll', function (e) {
e.preventDefault()
})
});
$('form').on('blur', 'input[type=number]', function (e) {
$(this).off('wheel.disableScroll')
});
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -0,0 +1,93 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- 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">Zeiterfassung Buchungsarten</li>
</ol>
</div>
<h4 class="page-title">Zeiterfassung Buchungsarten</h4>
</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 Zeiterfassung Buchungsarten</h4>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("TimerecordingCategory", "add") ?>"><i
class="fas fa-plus"></i> <span class="d-none d-lg-inline-block"> Neuen Buchungsart anlegen</span></a>
</div>
</div>
</div>
<table id="datatable" class="table table-striped table-hover table-sm">
<thead>
<tr>
<th class="text-center">Beizeichnung</th>
<th class="text-center">BMD KZ</th>
<th class="text-center">Buchungszeitraum</th>
<th class="text-center">Genehmigungspflichtig</th>
<th class="text-center">Anmerkung Pflichtfeld</th>
<th class="edit-width"></th>
</tr>
<tr id="filterrow">
<th></th>
<th></th>
<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 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>
<a href="<?= self::getUrl("TimerecordingCategory", "delete", ["id" => $timerecordingcategories->id]) ?>"
onclick="if(!confirm('Zeiterfassung Kategorie wirklich löschen?')) return false;" class="text-danger"
title="Löschen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var hidesearch = [5];
$(document).ready(function () {
});
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -0,0 +1,290 @@
<?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"/>
<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: 22px;
display: inline-block;
}
.fa-square-check {
color: #23b900;
font-size: 17px;
vertical-align: middle;
margin-bottom: 2px;
margin-right: 3px;
}
</style>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- 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 -->
<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 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">Summe</th>
<th class="text-center text-nowrap">Buchungsart</th>
<th class="text-center">Anmerkung</th>
<th class="text-center edit-width-large">Freigabe</th>
<th class="edit-width text-center"></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 ($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>';
}
$approved = 'Offen';
if ($timerecording->approved == 1) $approved = 'Genehmigt';
$completed = 'Genehmigt';
// if ($timerecording->completed == 1) $completed = 'Genehmigt';
?>
<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 class="text-center"><?= $approved ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<?php if ($timerecording->completed == 0):
if ($timerecording->approved == 0) : ?>
<a href="<?= self::getUrl("TimerecordingPermit", "approve", ["id" => $timerecording->id]) ?>"
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>
<?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>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var hidesearch = [2, 3, 4, 8];
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>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -0,0 +1,264 @@
<?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 -->
<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 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">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>-->
</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 ($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>
</div>
</div>
</div>
</div>
<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();
$("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>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>

View File

@@ -59,10 +59,10 @@ $pagination_entity_name = "Benutzer";
<?php if (is_array($filter) && count($filter) && is_numeric($filter['address_id'])): ?>
<a class="btn btn-primary"
href="<?= self::getUrl("User", "add", ['address_id' => $filter['address_id']]) ?>"><i
class="fas fa-plus"></i> Neuen Benutzer anlegen</a>
class="fas fa-plus"></i><span class="d-none d-lg-inline"> Neuen Benutzer anlegen</span></a>
<?php else: ?>
<a class="btn btn-primary" href="<?= self::getUrl("User", "add") ?>"><i
class="fas fa-plus"></i> Neuen Benutzer anlegen</a>
class="fas fa-plus"></i><span class="d-none d-lg-inline"> Neuen Benutzer anlegen</span></a>
<?php endif; ?>
</div>
</div>
@@ -105,7 +105,7 @@ $pagination_entity_name = "Benutzer";
}
?>
<tr>
<td><?= $user->username ?></td>
<td class="text-nowrap"><?= $user->username ?></td>
<td><?= $user->name ?></td>
<td><?= ($user->address->company) ? $user->address->company : $user->address->getFullName() ?></td>
<td><?= $user->email ?></td>
@@ -121,7 +121,7 @@ $pagination_entity_name = "Benutzer";
<a href="<?= self::getUrl("User", "delete", ['id' => $user->id]) ?>"
class="text-danger" title="User löschen"
onclick="if(!confirm('Benutzer wirklich löschen?')) return false;"><i
class="far fa-trash-alt"></i></a>
class="fas fa-trash"></i></a>
<?php endif; ?>
</td>
</tr>

View File

@@ -1,4 +1,6 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<style>
@@ -8,6 +10,11 @@
font-size: 16px;
margin-left: 5px;
}
.alert {
margin-bottom: 0px;
}
</style>
<div class="row">
<div class="col-12">
@@ -67,9 +74,11 @@ if ($twofa == 0) {
value="<?= $userprofile->email ?>" <?php if ($twofa == 1) : ?> disabled="disabled" <?php endif; ?> />
</div>
<?php if ($twofa == 1) : ?>
<div class="col-lg-4 col-form-label">
<div class="col-lg-4 ">
<span class="info-span alert alert-info"> Um die Email Adresse zu ändern bitte 2FA auf SMS umschalten.</span>
<div class="info-span alert alert-info"> Um die Email Adresse zu ändern
bitte 2FA auf SMS umschalten.
</div>
</div>
<?php endif; ?>
@@ -84,7 +93,7 @@ if ($twofa == 0) {
value="<?= $userprofile->mobile ?>" <?php if ($twofa == 2) : ?> disabled="disabled" <?php endif; ?>/>
</div>
<?php if ($twofa == 2) : ?>
<div class="col-lg-4 col-form-label">
<div class="col-lg-4 ">
<span class="info-span alert alert-info"> Um die Mobilnummer zu ändern bitte 2FA auf Email umschalten.</span>
</div>
<?php endif; ?>

View File

@@ -1,29 +1,8 @@
<?php
?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<?php var_dump($userprofile); ?>
<!-- start page title -->
<style>
.fa-exclamation-triangle {
font-size: 19px;
color: red;
}
.fa-new-code {
cursor: pointer;
color: #007bff;
font-size: 16px;
margin-left: 5px;
}
.fa-envelope, .fa-mobile-retro {
font-size: 25px;
vertical-align: sub;
margin-right: 5px;
}
</style>
<div class="row">
<div class="col-12">
<div class="page-title-box">
@@ -31,151 +10,187 @@
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
</li>
<li class="breadcrumb-item active">Gerätetyp</li>
</ol>
</div>
<h4 class="page-title">Benutzerprofil</h4>
<h4 class="page-title">Gerätetyp</h4>
</div>
</div>
</div>
<!-- end page title -->
<?php
if ($userprofile->twofactor == 0) {
$twoFactorsym = '<i class="fa fa-exclamation-triangle mr-1"></i>';
$twoFactorbtn = '<button class="btn btn-success mb-3 ">Aktivieren</button>';
$twoFactortype = '<div class="col-lg-2">
<select class="select2 form-control" name="twofactor" id="twofactor">
<option value="1">Email</option>
<option value="2">SMS</option>
</select></div>';
$twoFactorFormaction = "code2faaction";
} else if ($userprofile->twofactor == 1) {
$twoFactorsym = '<i class="fa-regular fa-circle-check mr-1"></i>';
$twoFactorbtn = '<button class="btn btn-success mb-3 ">Ändern zu SMS</button>';
$twoFactortype = '<label class="col-lg-2 col-form-label"><input type="hidden" name="twofactor" value="2"/><i class="fa-light fa-envelope"></i> Email</label>';
$twoFactorFormaction = "change2faaction";
} else if ($userprofile->twofactor == 2) {
$twoFactorsym = '<i class="fa-regular fa-circle-check mr-1"></i>';
$twoFactorbtn = '<button class="btn btn-success mb-3 ">Ändern zu Email</button>';
$twoFactortype = '<label class="col-lg-2 col-form-label"><input type="hidden" name="twofactor" value="1"/><i class="fa-light fa-mobile-retro"></i> Mobiltelefon (SMS)</label>';
$twoFactorFormaction = "change2faaction";
}
?>
<i class="bi bi-exclamation-triangle"></i>
<div class="row">
<div class="col-lg">
<div class="card">
<div class="card-body">
<h4 class=" mb-2">Allgemeine Daten</h4>
<div class="form-group row">
<div class="col-lg-2 font-weight-500">Name</div>
<div class="col-lg-10">
<?= $userprofile->name ?>
</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 Gerätetypen</h4>
</div>
<div class="form-group row">
<div class="col-lg-2 font-weight-500">Email</div>
<div class="col-lg-10">
<?= $userprofile->email ?>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Devicetype", "add") ?>"><i
class="fas fa-plus"></i> Neuen Gerätetyp anlegen</a>
</div>
<div class="form-group row">
<div class="col-lg-2 font-weight-500">Mobiltelefon</div>
<div class="col-lg-10">
<?= $userprofile->mobile ?>
</div>
</div>
<div class="form-group row">
<div class="col-lg-10">
<a class="btn btn-primary mb-2"
href="<?= self::getUrl("UserProfile", "edit") ?>">Bearbeiten</a>
</div>
</div>
<div class="w-100 border-bottom"></div>
</div>
</div>
<h4 class=" mb-2 mt-3">Passwort ändern</h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "changepwd") ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="oldpwd">altes Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="oldpwd" id="oldpwd"
value="">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="newpwd">neues Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="newpwd" id="newpwd"
value="">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="checkpwd">Passwort bestätigen</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="checkpwd" id="checkpwd"
value="">
</div>
</div>
<div class="form-group row">
<div class="col-lg-10">
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</div>
</form>
<div class="w-100 border-bottom"></div>
<h4 class="form-group mb-2 mt-3">2FA</h4>
<?php if (!$verification || $verification == 0): ?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", $twoFactorFormaction) ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="twofactor"><?= $twoFactorsym ?>
Zwei-Faktor-Authentifizierung</label>
<?= $twoFactortype ?>
<div class="col-lg-7">
<?= $twoFactorbtn ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<table id="datatable" class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th class="text-center">Hersteller</th>
<th class="text-right">Preis</th>
<th class="text-right">max. Leistung</th>
<th class="text-right">erstellt von</th>
<th class="edit-weight"></th>
</tr>
<tr id="filterrow">
<th>Name</th>
<th>Hersteller</th>
<th>Preis</th>
<th></th>
<th></th>
<th></th>
</tr>
<thead>
<tbody>
<?php foreach ($devicetypes as $devicetype): ?>
<tr>
<td><?= $devicetype->name ?></td>
<td class="text-center"><?= $devicetype->devicemanufactor->name ?></td>
<td class="text-right"><?= $devicetype->price ?> €</td>
<td class="text-right"><?= $devicetype->power ?> Watt</td>
<td class="text-right"><?= $devicetype->creator->name ?>
(<?= date("d.m.Y , H:i", $devicetype->create) ?>)
</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("Devicetype", "edit", ["id" => $devicetype->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?= self::getUrl("Devicetype", "delete", ["id" => $devicetype->id]) ?>"
onclick="if(!confirm('Gerätetyp wirklich löschen?')) return false;" class="text-danger"
title="Löschen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var hidesearch=[5];
$(document).ready(function () {
});
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?> <div class="col-lg-10">
<a class="btn btn-primary mb-2"
href="<?= self::getUrl("UserProfile", "edit") ?>">Bearbeiten</a>
</div>
</div>
</form>
<?php elseif ($verification == 1 || $verification == 2) :
if ($verification == 1) {
$verificationType = "Email";
} elseif ($verification == 2) {
$verificationType = "SMS";
}
?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "activate2faaction") ?>">
<div class="row">
<div class="col-lg-2"></div>
<label class="col-lg-3 col-form-label"
style="vertical-align: top;font-size: 15px;color: #000;"> Code wurde
per <?php echo $verificationType; ?> verschickt (5 Minuten gültig)</label>
<div class="w-100 border-bottom"></div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="code">Verifizierungscode: <i
data-codetype="<?= $verification ?>"
class="fa-solid fa-arrows-rotate fa-new-code" id="new-authcode"
title="Neuen Code anfordern."></i></label>
<div class="col-lg-2">
<input type="number" required min="0" max="99999" class="form-control" name="code"
id="code"
value="">
<input type="hidden" name="twofactor" value="<?php echo $verification; ?>"/>
<h4 class=" mb-2 mt-3">Passwort ändern</h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "changepwd") ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="oldpwd">altes Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="oldpwd" id="oldpwd"
value="">
</div>
</div>
<div class="col-lg-7">
<?= $twoFactorbtn ?>
<a href="<?= self::getUrl("UserProfile") ?>">
<button type="button" class="btn btn-secondary mb-3">Abbrechen</button>
</a>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="newpwd">neues Passwort</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="newpwd" id="newpwd"
value="">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="checkpwd">Passwort bestätigen</label>
<div class="col-lg-2">
<input type="password" class="form-control" name="checkpwd" id="checkpwd"
value="">
</div>
</div>
<div class="form-group row">
<div class="col-lg-10">
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</div>
</form>
<div class="w-100 border-bottom"></div>
<h4 class="form-group mb-2 mt-3">2FA</h4>
<?php if (!$verification || $verification == 0): ?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", $twoFactorFormaction) ?>">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="twofactor"><?= $twoFactorsym ?>
Zwei-Faktor-Authentifizierung</label>
<?= $twoFactortype ?>
<div class="col-lg-7">
<?= $twoFactorbtn ?>
</div>
</div>
</form>
<?php elseif ($verification == 1 || $verification == 2) :
if ($verification == 1) {
$verificationType = "Email";
} elseif ($verification == 2) {
$verificationType = "SMS";
}
?>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("UserProfile", "activate2faaction") ?>">
<div class="row">
<div class="col-lg-2"></div>
<label class="col-lg-3 col-form-label"
style="vertical-align: top;font-size: 15px;color: #000;"> Code wurde
per <?php echo $verificationType; ?> verschickt (5 Minuten gültig)</label>
</form>
<?php endif; ?>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="code">Verifizierungscode: <i
data-codetype="<?= $verification ?>"
class="fa-solid fa-arrows-rotate fa-new-code" id="new-authcode"
title="Neuen Code anfordern."></i></label>
<div class="col-lg-2">
<input type="number" required min="0" max="99999" class="form-control"
name="code"
id="code"
value="">
<input type="hidden" name="twofactor" value="<?php echo $verification; ?>"/>
</div>
<div class="col-lg-7 check-button">
<?= $twoFactorbtn ?>
<a href="<?= self::getUrl("UserProfile") ?>">
<button type="button" class="btn btn-secondary mb-3">Abbrechen</button>
</a>
</div>
</div>
</form>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>

View File

@@ -22,6 +22,20 @@
tickIcon: "check",
sanitize: false
});
$('.navbar-toggle').on('click', function (event) {
console.log('cracy');
$(this).toggleClass('open');
$('#navigation').slideToggle(400);
});
$('.navigation-menu>li').slice(-2).addClass('last-elements');
$('.navigation-menu li.has-submenu a[href="#"]').on('click', function (e) {
if ($(window).width() < 992) {
e.preventDefault();
$(this).parent('li').toggleClass('open').find('.submenu:first').toggleClass('open');
}
});
</script>
</body>
</html>

View File

@@ -19,7 +19,7 @@
<link href="<?=self::getResourcePath()?>assets/css/bootstrap-select.min.css" rel="stylesheet" type="text/css" />
<link href="<?=self::getResourcePath()?>css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />
<link href="<?=self::getResourcePath()?>plugins/summernote/summernote-bs4.css" rel="stylesheet" type="text/css" />
<link href="<?=self::getResourcePath()?>datatables/datatables.min.css" rel="stylesheet" type="text/css" />
<link href="<?=self::getResourcePath()?>datatables/datatables.min.css?<?=date('U')?>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=self::getResourcePath()?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>assets/libs/select2/select2.full.min.js"></script>
@@ -32,7 +32,7 @@
<script type="text/javascript" src="<?=self::getResourcePath()?>js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>assets/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>js/bootstrap-autocomplete.min.js"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>datatables/datatables.min.js"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>datatables/datatables.min.js?<?=date('U')?>"></script>
<?php if(MFAPPNAME == "devthetool"): ?>
<style type="text/css">

View File

@@ -29,7 +29,18 @@
</ul>
</li>
<?php endif; ?>
<?php if($me->is("employee")): ?>
<li class="has-submenu"><a href="#"><i class="far fa-fw fa-calendar-clock"></i>Zeiterfassung <div class="arrow-down"></div></a>
<ul class="submenu">
<li><a href="<?=self::getUrl("Timerecording")?>"><i class="far fa-fw fa-calendar text-info"></i> Buchungen</a></li>
<?php if ($me->can('Fibu')): ?>
<li><a href="<?=self::getUrl("TimerecordingCategory")?>"><i class="far fa-fw fa-list text-info"></i> Buchungsarten</a></li>
<li><a href="<?=self::getUrl("TimerecordingPermit")?>"><i class="far fa-fw fa-calendar-check text-info"></i> Freigaben</a></li>
<li><a href="<?=self::getUrl("TimerecordingReport")?>"><i class="far fa-fw fa-chart-pie text-info"></i> Auswertungen</a></li>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
<?php if($me->is(["Admin"]) || ($me->is("netowner") && $me->hasGwrNetworks())): ?>
<li class="has-submenu">
<a href="#">
@@ -38,36 +49,36 @@
<ul class="submenu">
<?php if($me->is(["Admin"])): ?>
<li class="has-sub-submenu font-weight-bold"><a>Betriebsstammdaten</a></li>
<li><a href="<?=self::getUrl("Address")?>"><i class="fad fa-fw fa-user text-info"></i> Personen & Firmen</a></li>
<li><a href="<?=self::getUrl("Product")?>"><i class="far fa-fw fa-rectangle-list text-info"></i> Produkte</a></li>
<li><a href="<?=self::getUrl("Productgroup")?>"><i class="far fa-fw fa-list-tree text-info"></i> Produktgruppen</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("Address")?>"><i class="fad fa-fw fa-user text-info"></i> Personen & Firmen</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("Product")?>"><i class="far fa-fw fa-rectangle-list text-info"></i> Produkte</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("Productgroup")?>"><i class="far fa-fw fa-list-tree text-info"></i> Produktgruppen</a></li>
<li><a href="<?=self::getUrl("Network")?>"><i class="fad fa-fw fa-network-wired text-info"></i> Netzgebiete</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("Network")?>"><i class="fad fa-fw fa-network-wired text-info"></i> Netzgebiete</a></li>
<li class="has-sub-submenu" ><a href="<?=self::getUrl("Pop")?>"><i class="fad fa-fw fa-house text-info"></i> Pops</a></li>
<li ><a href="<?=self::getUrl("Devicemanufactor")?>"><i class="fad fa-fw fa-router text-info"></i> Geräte Hersteller</a></li>
<li><a href="<?=self::getUrl("Devicetype")?>"><i class="fad fa-fw fa-router text-info"></i> Geräte Typen</a></li>
<li class="has-sub-submenu"><a href="<?=self::getUrl("Device")?>"><i class="fad fa-fw fa-router text-info "></i> Devices</a></li>
<li class="has-sub-submenu"><a href="<?=self::getUrl("User")?>"><i class="fad fa-fw fa-users text-info"></i> Benutzer</a></li>
<li class="has-sub-submenu font-weight-bold mt-1"><a>Grundstammdaten</a></li>
<li class="has-sub-submenu font-weight-bold mt-1 mobile-hide"><a>Grundstammdaten</a></li>
<?php endif; ?>
<?php if($me->is(["Admin"]) || ($me->is("netowner") && $me->hasGwrNetworks())): ?>
<li><a href="<?=self::getUrl("AddressDB")?>"><i class="fas fa-fw fa-city text-info"></i> GWR / AddressDB</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("AddressDB")?>"><i class="fas fa-fw fa-city text-info "></i> GWR / AddressDB</a></li>
<?php endif; ?>
<?php if($me->is(["Admin"])): ?>
<li><a href="<?=self::getUrl("OpenAccessId")?>"><i class="fad fa-fw fa-link-simple text-info"></i> Open Access IDs</a></li>
<li><a href="<?=self::getUrl("Producttech")?>"><i class="fad fa-fw fa-microchip text-info"></i> Technologien</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("OpenAccessId")?>"><i class="fad fa-fw fa-link-simple text-info"></i> Open Access IDs</a></li>
<li class="mobile-hide"><a href="<?=self::getUrl("Producttech")?>"><i class="fad fa-fw fa-microchip text-info"></i> Technologien</a></li>
<!--<li><a href="<?=self::getUrl("Contractconfig")?>"><i class="fad fa-gear text-info"></i> ContractConfig</a></li>-->
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
<?php if($me->is(["Admin","netowner","lineplanner","pipeplanner","pipeworker","lineworker"])): ?>
<li class="has-submenu">
<li class="has-submenu mobile-hide">
<a href="#">
<i class="fas fa-fw fa-hard-hat"></i>Netzbau <div class="arrow-down"></div>
</a>
@@ -82,7 +93,7 @@
<?php endif; ?>
<?php if($me->is(["Admin"]) || $me->can(["Cpeprovisioning", "Cpeshipping"])): ?>
<li class="has-submenu">
<li class="has-submenu mobile-hide">
<a href="#">
<i class="fad fa-fw fa-running"></i>Netzbetrieb <div class="arrow-down"></div>
</a>
@@ -94,7 +105,7 @@
<?php endif; ?>
<?php if($me->is(["Admin"]) || $me->can("Voipnumbering")): ?>
<li class="has-submenu">
<li class="has-submenu mobile-hide">
<a href="#">
<i class="fad fa-fw fa-phone"></i>Telefonie <div class="arrow-down"></div>
</a>
@@ -104,9 +115,9 @@
</ul>
</li>
<?php endif; ?>
<?php if($me->is(["Admin","netowner","salespartner"]) || $me->can(["Order", "Preorder"])): ?>
<li class="has-submenu">
<li class="has-submenu mobile-hide">
<a href="#">
<i class="fal fa-fw fa-money-bill-wave"></i>Verkauf <div class="arrow-down"></div>
</a>
@@ -134,7 +145,7 @@
</li>
<?php endif; ?>
-->
<?php endif; ?>
</ul>
<!-- End navigation menu -->

View File

@@ -31,8 +31,8 @@ if ($requesttype == "2fa" || $requesttype == "false2fa") {
<div class="row justify-content-center mb-3 mt-1">
<div class="form-check">
<input type="checkbox" value="true" name="Remember" class="form-check-input">
<label class="form-check-label text-bold" for="Remember">
<input type="checkbox" value="true" name="Remember" id="Remember" class="form-check-input">
<label class="form-check-label text-bold noselect" for="Remember">
angemeldet bleiben
</label>
@@ -87,6 +87,16 @@ if ($requesttype == "2fa" || $requesttype == "false2fa") {
.cursor-pointer {
cursor: pointer;
}
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome, Edge, Opera and Firefox */
cursor: pointer;
}
</style>
</head>
<body class="hold-transition login-page" onload="setFocus()">
@@ -144,6 +154,14 @@ if ($requesttype == "2fa" || $requesttype == "false2fa") {
document.getElementById('mfUsername').focus();
}
$('body').on('click', '.form-check-label', function (event) {
if ($('Remember').prop("checked")) {
$('Remember').prop("checked", false);
} else {
$('Remember').prop("checked", true);
}
});
$('body').on('click', '#new-authcode', function (event) {
$('#TwofactorCode').remove();
$('form').submit();

View File

@@ -15,25 +15,42 @@ class Device extends mfBaseModel
return null;
}
if ($name == "creator") {
$this->creator = new User($this->create_by);
if($name == "creator") {
$this->creator = mfValuecache::singleton()->get("Worker-id-".$this->create_by);
if($this->creator === null) {
$this->creator = new User($this->create_by);
if($this->creator->id) {
mfValuecache::singleton()->set("Worker-id-".$this->create_by, $this->creator);
}
}
return $this->creator;
}
if ($name == "editor") {
$this->editor = new User($this->edit_by);
if($name == "editor") {
$this->editor = mfValuecache::singleton()->get("Worker-id-".$this->edit_by);
if($this->editor === null) {
$this->editor = new User($this->edit_by);
if($this->editor->id) {
mfValuecache::singleton()->set("Worker-id-".$this->edit_by, $this->editor);
}
}
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name . "_id";
$this->$name = new $classname($this->$idfield);
$idfield = $name."_id";
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
if(!$this->$name) {
$this->$name = new $classname($this->$idfield);
}
if ($this->$name->id) {
if($this->$name->id) {
mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name);
return $this->$name;
} else {
return null;
}
}
return $this->$name;

View File

@@ -15,24 +15,41 @@ class Devicetype extends mfBaseModel
}
if ($name == "creator") {
$this->creator = new User($this->create_by);
$this->creator = mfValuecache::singleton()->get("Worker-id-" . $this->create_by);
if ($this->creator === null) {
$this->creator = new User($this->create_by);
if ($this->creator->id) {
mfValuecache::singleton()->set("Worker-id-" . $this->create_by, $this->creator);
}
}
return $this->creator;
}
if ($name == "editor") {
$this->editor = new User($this->edit_by);
$this->editor = mfValuecache::singleton()->get("Worker-id-" . $this->edit_by);
if ($this->editor === null) {
$this->editor = new User($this->edit_by);
if ($this->editor->id) {
mfValuecache::singleton()->set("Worker-id-" . $this->edit_by, $this->editor);
}
}
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name . "_id";
$this->$name = new $classname($this->$idfield);
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-" . $this->$idfield);
if (!$this->$name) {
$this->$name = new $classname($this->$idfield);
}
if ($this->$name->id) {
mfValuecache::singleton()->set("mfObjectmodel-$name-" . $this->$name->id, $this->$name);
return $this->$name;
} else {
return null;
}
}
return $this->$name;

View File

@@ -114,7 +114,7 @@ class Network extends mfBaseModel {
}
if($name == "pops") {
$pops = PopModel::search(['network_id' => $this->id]);
$pops = PopNetworkModel::search(['network_id' => $this->id]);
$this->pops = $pops;
return $this->pops;
}

View File

@@ -5,18 +5,49 @@ class Pop extends mfBaseModel {
private $network;
public function getProperty($name) {
if($this->$name == null) {
if ($this->$name == null) {
if (!$this->id) {
return null;
}
if($name == "creator") {
$this->creator = mfValuecache::singleton()->get("Worker-id-".$this->create_by);
if($this->creator === null) {
$this->creator = new User($this->create_by);
if($this->creator->id) {
mfValuecache::singleton()->set("Worker-id-".$this->create_by, $this->creator);
}
}
return $this->creator;
}
if($name == "editor") {
$this->editor = mfValuecache::singleton()->get("Worker-id-".$this->edit_by);
if($this->editor === null) {
$this->editor = new User($this->edit_by);
if($this->editor->id) {
mfValuecache::singleton()->set("Worker-id-".$this->edit_by, $this->editor);
}
}
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
if(!$this->$name) {
$this->$name = new $classname($this->$idfield);
}
if($this->$name->id) {
mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name);
return $this->$name;
} else {
return null;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);
if($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}

View File

@@ -21,7 +21,8 @@ class PopController extends mfBaseController
{
$this->layout()->setTemplate("Pop/Index");
$pops = PopModel::getAll();
$pops = PopModel::getAlladv();
$this->layout()->set("pops", $pops);
}
@@ -40,7 +41,8 @@ class PopController extends mfBaseController
$this->layout()->setFlash("Pop nicht gefunden", "error");
$this->redirect("Pop");
}
$popnetwork = PopNetworkModel::getbyPopid($id);
$this->layout()->set("popnetwork", implode(', ' , $popnetwork['name']));
$this->layout()->setTemplate("Pop/Detail");
$filter['pop_id'] = $id;
$this->layout()->set("popracks", PoprackModel::getAllbyPop($id));
@@ -76,6 +78,8 @@ class PopController extends mfBaseController
$this->redirect("Network");
}
$popnetwork = PopNetworkModel::getbyPopid($id);
$this->layout()->set("popnetwork", $popnetwork['network_id']);
$this->layout()->set("pop", $pop);
return $this->addAction();
}
@@ -106,7 +110,8 @@ class PopController extends mfBaseController
}
$data = [];
$data['network_id'] = $r->network_id;
$data['name'] = $r->name;
$data['gps_lat'] = ($r->gps_lat) ? $r->gps_lat : null;
$data['gps_long'] = ($r->gps_long) ? $r->gps_long : null;
@@ -127,11 +132,34 @@ class PopController extends mfBaseController
$new_id = $pop->save();
if (!$new_id) {
$this->layout()->setFlash("Fehler beim Speichern", "error");
$this->layout()->set("network", $network);
return $this->addAction();
}
if ($r->network_id) {
$oldPopnetworks = json_encode(PopNetworkModel::getbyPopid($new_id));
$result = array_diff($r->network_id, $oldPopnetworks);
if ($oldPopnetworks != json_encode($r->network_id)) {
PopNetworkModel::deletebyPopid($new_id);
unset($data);
$data = [];
foreach ($r->network_id as $networkid) {
$data['network_id'] = $networkid;
$data['pop_id'] = $new_id;
$popNetwork = PopNetworkModel::create($data);
$popNetwork->save();
}
}
}
if ($this->request->returnto) {
$returnAction = "Index";
$returnVariables = array();

View File

@@ -1,130 +1,163 @@
<?php
class PopModel {
public $name = null;
public $network_id = null;
public $gps_lat = null;
public $gps_long = null;
public $location = null;
public $vlan_public = null;
public $vlan_nat = null;
public $vlan_ipv6 = null;
public $note = null;
public $create_by = null;
public $edit_by = null;
public $create = null;
public $edit = null;
public static function find($data) {
}
public static function create(Array $data) {
$model = new Pop();
foreach($data as $field => $value) {
if(property_exists(get_called_class(), $field)) {
if(substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
class PopModel
{
public $name = null;
public $network_id = null;
public $gps_lat = null;
public $gps_long = null;
public $location = null;
public $vlan_public = null;
public $vlan_nat = null;
public $vlan_ipv6 = null;
public $note = null;
public $create_by = null;
public $edit_by = null;
public $create = null;
public $edit = null;
public static function find($data)
{
}
public static function create(array $data)
{
$model = new Pop();
foreach ($data as $field => $value) {
if (property_exists(get_called_class(), $field)) {
if (substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
}
$model->$field = $value;
}
}
$model->$field = $value;
}
}
$me = mfValuecache::singleton()->get("me");
if(!$me) {
$me = new User();
$me->loadMe();
mfValuecache::singleton()->set("me", $me);
$me = mfValuecache::singleton()->get("me");
if (!$me) {
$me = new User();
$me->loadMe();
mfValuecache::singleton()->set("me", $me);
}
if ($model->create_by === null) {
$model->create_by = $me->id;
}
if ($model->edit_by === null) {
$model->edit_by = $me->id;
}
return $model;
}
if($model->create_by === null) {
$model->create_by = $me->id;
}
if($model->edit_by === null) {
$model->edit_by = $me->id;
}
return $model;
}
public static function getOne($id) {
if(!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("Pop", "*", "id=$id LIMIT 1");
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Pop($data);
}
return $item;
}
public static function getAll() {
$items = [];
$db = FronkDB::singleton();
$res = $db->select("Pop", "*","1=1 ORDER by name");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Pop($data);
}
}
return $items;
}
public static function getFirst() {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Pop", "*", "$where ORDER BY name, network_id");
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Pop($data);
if($item->id) {
public static function getOne($id)
{
if (!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("Pop", "*", "id=$id LIMIT 1");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Pop($data);
}
return $item;
} else {
return null;
}
}
return null;
}
public static function search($filter) {
$items = [];
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Pop", "*", "$where ORDER BY name, network_id");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Pop($data);
}
}
return $items;
}
private static function getSqlFilter($filter) {
$where = "1=1 ";
//var_dump($filter);exit;
if(array_key_exists("network_id", $filter)) {
$networkid = $filter['network_id'];
if(is_numeric($networkid)) {
$where .= " AND network_id=$networkid";
}
public static function getAll()
{
$items = [];
$db = FronkDB::singleton();
$res = $db->select("Pop", "*", "1=1 ORDER by name");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new Pop($data);
}
}
return $items;
}
//var_dump($filter, $where);exit;
return $where;
}
public static function getAlladv()
{
$items = [];
$db = FronkDB::singleton();
$sql = "SELECT `Pop`.`id`, `Pop`.`network_id`, `Pop`.`name`, `Pop`.`gps_lat`, `Pop`.`gps_long`, `Pop`.`location`, `Pop`.`vlan_public`, `Pop`.`vlan_nat`, `Pop`.`vlan_ipv6`, `Pop`.`note`,`Network`.`name` as Networkname FROM `Pop`
INNER JOIN `PopNetwork` ON (`Pop`.`id`=`PopNetwork`.`pop_id`)
INNER JOIN `Network` ON (`Network`.`id`=`PopNetwork`.`network_id`)";
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_array($res)) {
$Pops[$data['id']]['data'] = $data;
$Pops[$data['id']]['networks'][] = $data['Networkname'];
}
}
foreach ($Pops as $key => $Pop) {
$Pop['data']['networks'] = implode(', ', $Pop['networks']);
$items[] = new Pop((object)$Pop['data']);
}
return $items;
}
public static function getFirst()
{
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Pop", "*", "$where ORDER BY name, network_id");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Pop($data);
if ($item->id) {
return $item;
} else {
return null;
}
}
return null;
}
public static function search($filter)
{
$items = [];
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Pop", "*", "$where ORDER BY name, network_id");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new Pop($data);
}
}
return $items;
}
private static function getSqlFilter($filter)
{
$where = "1=1 ";
//var_dump($filter);exit;
if (array_key_exists("network_id", $filter)) {
$networkid = $filter['network_id'];
if (is_numeric($networkid)) {
$where .= " AND network_id=$networkid";
}
}
//var_dump($filter, $where);exit;
return $where;
}
}

View File

@@ -0,0 +1,44 @@
<?php
class PopNetwork extends mfBaseModel
{
private $editor;
private $creator;
private $pop;
private $network;
public function getProperty($name)
{
if ($this->$name == null) {
if (!$this->id) {
return null;
}
if ($name == "creator") {
$this->creator = new User($this->create_by);
return $this->creator;
}
if ($name == "editor") {
$this->editor = new User($this->edit_by);
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name . "_id";
$this->$name = new $classname($this->$idfield);
if ($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}

View File

@@ -0,0 +1,154 @@
<?php
class PopNetworkModel
{
private $pop_id;
private $network_id;
public static function find($data)
{
}
public static function create(array $data)
{
$model = new PopNetwork();
foreach ($data as $field => $value) {
if (property_exists(get_called_class(), $field)) {
if (substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
}
$model->$field = $value;
}
}
$me = mfValuecache::singleton()->get("me");
if (!$me) {
$me = new User();
$me->loadMe();
mfValuecache::singleton()->set("me", $me);
}
if ($model->create_by === null) {
$model->create_by = $me->id;
}
if ($model->edit_by === null) {
$model->edit_by = $me->id;
}
return $model;
}
public static function getOne($id)
{
if (!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("PopNetwork", "*", "id=$id LIMIT 1");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new PopNetwork($data);
}
return $item;
}
public static function getAll()
{
$items = [];
$db = FronkDB::singleton();
$res = $db->select("PopNetwork", "*", "1=1");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new PopNetwork($data);
}
}
return $items;
}
public static function getbyPopid($pop_id)
{
$items = [];
$db = FronkDB::singleton();
$sql = "SELECT `PopNetwork`.`id`,`PopNetwork`.`network_id`,`Network`.`name` FROM `PopNetwork`
INNER JOIN `Network` ON (`Network`.`id`=`PopNetwork`.`network_id`)
WHERE `PopNetwork`.`pop_id`='" . $pop_id . "'";
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_array($res)) {
$items['network_id'][] = $data['network_id'];
$items['name'][] = $data['name'];
}
}
return $items;
}
public static function deletebyPopid($pop_id)
{
$db = FronkDB::singleton();
$sql = "DELETE FROM `PopNetwork` WHERE `pop_id`='" . $pop_id . "'";
$db->query($sql);
}
public static function getFirst()
{
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("PopNetwork", "*", "$where ");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new PopNetwork($data);
if ($item->id) {
return $item;
} else {
return null;
}
}
return null;
}
public static function search($filter)
{
$items = [];
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("PopNetwork", "*", "$where");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new PopNetwork($data);
}
}
return $items;
}
private static function getSqlFilter($filter)
{
$where = "1=1 ";
//var_dump($filter);exit;
if (array_key_exists("network_id", $filter)) {
$networkid = $filter['network_id'];
if (is_numeric($networkid)) {
$where .= " AND network_id=$networkid";
}
}
//var_dump($filter, $where);exit;
return $where;
}
}

View File

@@ -173,6 +173,28 @@ class PoprackModel
$response['success'] = true;
} else {
$response['success'] = false;
}
echo json_encode($response);
exit;
}
public static function getdispatchersleeve($dispatcher_id)
{
$items = [];
$db = FronkDB::singleton();
$sql = "SELECT `id`, `name` FROM `FiberPlanDispatchersleeve` WHERE fiberPlanDispatcher_id='" . $dispatcher_id . "' ";
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_array($res)) {
$items[] = $data;
}
$response['data'] = $items;
$response['success'] = true;
} else {
$response['success'] = false;
}

View File

@@ -33,6 +33,7 @@ class PoprackmoduleController extends mfBaseController
private function addModule()
{
$ports = 0;
$r = $this->request;
$id = $r->id;
$data = [];
@@ -40,7 +41,9 @@ class PoprackmoduleController extends mfBaseController
$data['type'] = $r->type;
if ($data['type'] == 0) {
$data['ports'] = ($r->ports) ? $r->ports : null;
$ports = $data['ports'];
$data['plug'] = ($r->plug) ? $r->plug : null;
}
if ($data['type'] == 1) {
$data['device_id'] = ($r->device_id) ? $r->device_id : null;
@@ -59,6 +62,16 @@ class PoprackmoduleController extends mfBaseController
$response['success'] = false;
} else {
$response['success'] = true;
if ($data['type'] == 0) {
unset($data);
$data = [];
$data['poprackmodule_id'] = $new_id;
for ($i = 1; $i <= $ports; $i++) {
$data['port'] = $i;
$poprackmodulepatch = PoprackmodulepatchModel::create($data);
$poprackmodulepatch->save();
}
}
}
echo json_encode($response);
exit;
@@ -82,12 +95,26 @@ class PoprackmoduleController extends mfBaseController
if ($r->type == 0) {
$data['ports'] = ($r->ports) ? $r->ports : null;
$data['plug'] = ($r->plug) ? $r->plug : null;
$poprackmodulepatchcounter = PoprackmodulepatchModel::countAllModule($id);
if ($poprackmodulepatchcounter > $data['ports']) {
for ($i = $poprackmodulepatchcounter; $i > $data['ports']; $i--) {
PoprackmodulepatchModel::deletebyPort($id, $i);
}
} else if ($poprackmodulepatchcounter < $data['ports']) {
$datapatchModel=[];
for ($i = $poprackmodulepatchcounter + 1; $i <= $data['ports']; $i++) {
$datapatchModel['poprackmodule_id'] = $id;
$datapatchModel['port'] = $i;
$poprackmodulepatch = PoprackmodulepatchModel::create($datapatchModel);
$poprackmodulepatch->save();
}
}
}
$data['name'] = ($r->name);
$poprackmodule->update($data);
$new_id = $poprackmodule->save();
// var_dump($r);die();
if (!$new_id) {
$response['success'] = false;
} else {

View File

@@ -0,0 +1,44 @@
<?php
class Poprackmodulepatch extends mfBaseModel
{
private $editor;
private $creator;
private $poprackmodule;
private $fiberPlanCable;
public function getProperty($name)
{
if ($this->$name == null) {
if (!$this->id) {
return null;
}
if ($name == "creator") {
$this->creator = new User($this->create_by);
return $this->creator;
}
if ($name == "editor") {
$this->editor = new User($this->edit_by);
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name . "_id";
$this->$name = new $classname($this->$idfield);
if ($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}

View File

@@ -0,0 +1,108 @@
<?php
class PoprackmodulepatchModel
{
private $poprackmodule_id;
private $port;
private $fiberPlanCable_id;
private $destination;
public $create_by = null;
public $edit_by = null;
public $create = null;
public $edit = null;
public static function find($data)
{
}
public static function create(array $data)
{
$model = new Poprackmodulepatch();
foreach ($data as $field => $value) {
if (property_exists(get_called_class(), $field)) {
if (substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
}
$model->$field = $value;
}
}
$me = mfValuecache::singleton()->get("me");
if (!$me) {
$me = new User();
$me->loadMe();
mfValuecache::singleton()->set("me", $me);
}
if ($model->create_by === null) {
$model->create_by = $me->id;
}
if ($model->edit_by === null) {
$model->edit_by = $me->id;
}
return $model;
}
public static function getOne($id)
{
if (!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("Poprackmodulepatch", "*", "id=$id LIMIT 1");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Poprackmodulepatch($data);
}
return $item;
}
public static function countAllModule($moduleId)
{
$items = [];
$db = FronkDB::singleton();
$sql = "SELECT `id` FROM `Poprackmodulepatch` WHERE `poprackmodule_id`='" . $moduleId . "'";
$res = $db->query($sql);
$countrows = $db->num_rows($res);
return $countrows;
}
public static function deletebyPort($moduleId, $port)
{
$db = FronkDB::singleton();
$sql = "DELETE FROM `Poprackmodulepatch` WHERE `port`='" . $port . "' AND `poprackmodule_id`='" . $moduleId . "'";
$res = $db->query($sql);
}
public static function updatebyPort($moduleId, $port, $fiberPlanCable_id)
{
$db = FronkDB::singleton();
$sql = "UPDATE `Poprackmodulepatch` SET fiberPlanCable_id='" . $fiberPlanCable_id . "' WHERE `port`='" . $port . "' AND `poprackmodule_id`='" . $moduleId . "'";
echo $sql . "\n";
$db->query($sql);
}
public static function updatebyPortRange($moduleId, $startport, $endport, $fiberPlanCable_id)
{
$db = FronkDB::singleton();
$sql = "UPDATE `Poprackmodulepatch` SET fiberPlanCable_id='" . $fiberPlanCable_id . "' WHERE `port`>='" . $startport . "' AND `port`<='" . $endport . "' AND `poprackmodule_id`='" . $moduleId . "'";
echo $sql . "\n";
$db->query($sql);
}
public static function clearPort($fiberPlanCable_id)
{
$db = FronkDB::singleton();
$sql = "UPDATE `Poprackmodulepatch` SET fiberPlanCable_id=NULL WHERE `fiberPlanCable_id`='" . $fiberPlanCable_id . "'";
$db->query($sql);
}
}

View File

@@ -0,0 +1,61 @@
<?php
class Timerecording extends mfBaseModel
{
private $editor;
private $creator;
private $user;
private $timerecordingCategory;
public function getProperty($name)
{
if ($this->$name == null) {
if (!$this->id) {
return null;
}
if($name == "creator") {
$this->creator = mfValuecache::singleton()->get("Worker-id-".$this->create_by);
if($this->creator === null) {
$this->creator = new User($this->create_by);
if($this->creator->id) {
mfValuecache::singleton()->set("Worker-id-".$this->create_by, $this->creator);
}
}
return $this->creator;
}
if($name == "editor") {
$this->editor = mfValuecache::singleton()->get("Worker-id-".$this->edit_by);
if($this->editor === null) {
$this->editor = new User($this->edit_by);
if($this->editor->id) {
mfValuecache::singleton()->set("Worker-id-".$this->edit_by, $this->editor);
}
}
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
if(!$this->$name) {
$this->$name = new $classname($this->$idfield);
}
if($this->$name->id) {
mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name);
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}

View File

@@ -0,0 +1,145 @@
<?php
class TimerecordingController extends mfBaseController
{
protected function init()
{
$this->needlogin = true;
$me = new User();
$me->loadMe();
$this->me = $me;
$this->layout()->set("me", $me);
if (!$me->is(["employee"])) {
$this->redirect("Dashboard");
}
}
protected function indexAction()
{
$this->layout()->setTemplate("Timerecording/Index");
$timerecordingCategoriess = TimerecordingCategoryModel::getAll();
$this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess);
$timerecordings = TimerecordingModel::search(['user_id' => $this->me->id]);
$this->layout()->set("timerecordings", $timerecordings);
}
protected function addAction()
{
$timerecordingCategoriess = TimerecordingCategoryModel::getAll();
$this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess);
$this->layout()->setTemplate("Timerecording/Form");
}
protected function editAction()
{
$id = $this->request->id;
if (!is_numeric($id) || !$id) {
$this->layout()->setFlash("Buchung nicht gefunden", "error");
$this->redirect("Timerecording");
}
$timerecordings = new Timerecording($id);
if ($timerecordings->id != $id) {
$this->layout()->setFlash("Buchung nicht gefunden", "error");
$this->redirect("Timerecording");
}
$this->layout()->set("timerecordings", $timerecordings);
return $this->addAction();
}
protected function saveAction()
{
$r = $this->request;
$id = $r->id;
$enddate = $r->enddate;
if (!$enddate && $r->start && $r->end) {
$starttime = strtotime($r->date . " " . $r->start . ":00");
$endtime = strtotime($r->date . " " . $r->end . ":00");
} elseif ($enddate) {
$starttime = strtotime($r->date . " 00:00:00");
$endtime = strtotime($enddate . " 23:59:00");
} else if (!$enddate && !$r->start && !$r->end) {
$starttime = strtotime($r->date . " 00:00:00");
$endtime = NULL;
}
if (is_numeric($id) && $id > 0) {
$mode = "edit";
$timerecordings = new Timerecording($id);
if (!$timerecordings->id) {
$this->layout()->setFlash("Buchungen nicht gefunden", "error");
$this->redirect("Timerecording");
}
} else {
$mode = "add";
}
$data = [];
$data['user_id'] = $this->me->id;
$data['start'] = $starttime;
$data['end'] = $endtime;
$data['timerecordingCategory_id'] = trim($r->timerecordingCategory_id);
$data['commend'] = trim($r->commend);
if (!$data['user_id']) {
$this->layout()->setFlash("Benutzer darf nicht leer sein", "error");
$this->redirect("Timerecording");
}
if ($data['start'] < 1577833200) {
$this->layout()->setFlash("Ungültige Startzeit", "error");
$this->redirect("Timerecording");
}
if ($data['end'] && $data['end'] < 1577833200) {
$this->layout()->setFlash("Ungültige Endzeit", "error");
$this->redirect("Timerecording");
}
if (!$data['timerecordingCategory_id']) {
$data['timerecordingCategory_id'] = NULL;
}
if (!$data['commend']) {
$data['commend'] = NULL;
}
if ($mode == "edit") {
$timerecordings->update($data);
} else {
$timerecordings = TimerecordingModel::create($data);
}
// var_dump($filestore);
// exit;
$id = $timerecordings->save();
if (!$id) {
$this->layout()->setFlash("Buchung konnte nicht angelegt werden", "error");
$this->redirect("Timerecording");
}
if ($mode == "edit") {
$this->layout()->setFlash("Buchung erfolgreich geändert", "success");
} else if ($mode = "add") {
$this->layout()->setFlash("Buchung erfolgreich angelegt", "success");
}
$this->redirect("Timerecording");
}
protected function deleteAction()
{
$id = $this->request->id;
$timerecordings = new Timerecording($id);
if (!$timerecordings->id || $timerecordings->id != $id) {
$this->layout()->setFlash("Buchung nicht gefunden.", "error");
$this->redirect("Timerecording");
}
$timerecordings->delete();
$this->redirect("Timerecording");
}
}

View File

@@ -0,0 +1,148 @@
<?php
class TimerecordingModel
{
private $user_id;
private $start;
private $end;
private $timerecordingCategory_id;
private $commend;
private $approved;
private $completed;
public static function find($data)
{
}
public static function create(array $data)
{
$model = new Timerecording();
foreach ($data as $field => $value) {
if (property_exists(get_called_class(), $field)) {
if (substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
}
$model->$field = $value;
}
}
$me = mfValuecache::singleton()->get("me");
if (!$me) {
$me = new User();
$me->loadMe();
mfValuecache::singleton()->set("me", $me);
}
if ($model->create_by === null) {
$model->create_by = $me->id;
}
if ($model->edit_by === null) {
$model->edit_by = $me->id;
}
return $model;
}
public static function getOne($id)
{
if (!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("Timerecording", "*", "id=$id LIMIT 1");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Timerecording($data);
}
return $item;
}
public static function getAll()
{
$items = [];
$db = FronkDB::singleton();
$res = $db->select("Timerecording", "*", "1=1");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new Timerecording($data);
}
}
return $items;
}
public static function getAllPermits()
{
$items = [];
$db = FronkDB::singleton();
$sql = "SELECT Timerecording.* FROM `Timerecording`
INNER JOIN `TimerecordingCategory` ON (`Timerecording`.`timerecordingCategory_id` = `TimerecordingCategory`.`id`)
WHERE `TimerecordingCategory`.`approval`='1'";
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new Timerecording($data);
}
}
return $items;
}
public static function getFirst()
{
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Timerecording", "*", "$where ");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new Timerecording($data);
if ($item->id) {
return $item;
} else {
return null;
}
}
return null;
}
public static function search($filter)
{
$items = [];
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Timerecording", "*", "$where");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new Timerecording($data);
}
}
return $items;
}
private static function getSqlFilter($filter)
{
$where = "1=1 ";
if (array_key_exists("user_id", $filter)) {
$userid = $filter['user_id'];
if (is_numeric($userid)) {
$where .= " AND user_id=$userid";
}
}
//var_dump($filter, $where);exit;
return $where;
}
}

View File

@@ -0,0 +1,41 @@
<?php
class TimerecordingCategory extends mfBaseModel
{
private $editor;
private $creator;
public function getProperty($name)
{
if ($this->$name == null) {
if (!$this->id) {
return null;
}
if ($name == "creator") {
$this->creator = new User($this->create_by);
return $this->creator;
}
if ($name == "editor") {
$this->editor = new User($this->edit_by);
return $this->editor;
}
$classname = ucfirst($name);
$idfield = $name . "_id";
$this->$name = new $classname($this->$idfield);
if ($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}

View File

@@ -0,0 +1,141 @@
<?php
class TimerecordingCategoryController extends mfBaseController
{
protected function init()
{
$this->needlogin = true;
$me = new User();
$me->loadMe();
$this->me = $me;
$this->layout()->set("me", $me);
if (!$me->can(["Fibu"])) {
$this->redirect("Dashboard");
}
}
protected function indexAction()
{
$this->layout()->setTemplate("TimerecordingCategories/Index");
$timerecordingcategoriesapproval = TimerecordingCategoryModel::$approval_definition;
$timerecordingcategorieshourday = TimerecordingCategoryModel::$hourday_definition;
$timerecordingcategoriesrequire_comment = TimerecordingCategoryModel::$require_comment_definition;
$timerecordingcategoriess = TimerecordingCategoryModel::getAll();
$this->layout()->set("timerecordingcategoriesrequire_comment", $timerecordingcategoriesrequire_comment);
$this->layout()->set("timerecordingcategorieshourday", $timerecordingcategorieshourday);
$this->layout()->set("timerecordingcategoriesapproval", $timerecordingcategoriesapproval);
$this->layout()->set("timerecordingcategoriess", $timerecordingcategoriess);
}
protected function addAction()
{
$timerecordingcategorieshourday = TimerecordingCategoryModel::$hourday_definition;
$this->layout()->set("timerecordingcategorieshourday", $timerecordingcategorieshourday);
$this->layout()->setTemplate("TimerecordingCategories/Form");
}
protected function editAction()
{
$id = $this->request->id;
if (!is_numeric($id) || !$id) {
$this->layout()->setFlash("Zeiterfassung Kategorie nicht gefunden", "error");
$this->redirect("TimerecordingCategory");
}
$timerecordingcategoriess = new TimerecordingCategory($id);
if ($timerecordingcategoriess->id != $id) {
$this->layout()->setFlash("Zeiterfassung Kategorie nicht gefunden", "error");
$this->redirect("TimerecordingCategory");
}
$timerecordingcategorieshourday = TimerecordingCategoryModel::$hourday_definition;
$this->layout()->set("timerecordingcategorieshourday", $timerecordingcategorieshourday);
$this->layout()->set("timerecordingcategoriess", $timerecordingcategoriess);
return $this->addAction();
}
protected function saveAction()
{
$r = $this->request;
$id = $r->id;
//var_dump($r->get());exit;
if (is_numeric($id) && $id > 0) {
$mode = "edit";
$timerecordingcategoriess = new TimerecordingCategory($id);
if (!$timerecordingcategoriess->id) {
$this->layout()->setFlash("Zeiterfassung Kategorien nicht gefunden", "error");
$this->redirect("TimerecordingCategory");
}
} else {
$mode = "add";
}
$data = [];
$data['name'] = trim($r->name);
$data['short'] = trim($r->short);
$data['hourday'] = trim($r->hourday);
$data['approval'] = trim($r->approval);
$data['require_comment'] = trim($r->require_comment);
if (!$data['name']) {
$data['name'] = NULL;
}
if (!$data['short']) {
$data['short'] = NULL;
}
if (!$data['approval']) {
$data['approval'] = 0;
}
if (!$data['require_comment']) {
$data['require_comment'] = 0;
}
// var_dump($_FILES);
// var_dump($upload);
// exit;
if ($mode == "edit") {
$timerecordingcategoriess->update($data);
} else {
$timerecordingcategoriess = TimerecordingCategoryModel::create($data);
}
// var_dump($filestore);
// exit;
$id = $timerecordingcategoriess->save();
if (!$id) {
$this->layout()->setFlash("Zeiterfassung Kategorie konnte nicht angelegt werden", "error");
$this->redirect("TimerecordingCategory");
}
if ($mode == "edit") {
$this->layout()->setFlash("Zeiterfassung Kategorie erfolgreich geändert", "success");
} else if ($mode = "add") {
$this->layout()->setFlash("Zeiterfassung Kategorie erfolgreich angelegt", "success");
}
$this->redirect("TimerecordingCategory");
}
protected function deleteAction()
{
$id = $this->request->id;
$timerecordingcategoriess = new TimerecordingCategory($id);
if (!$timerecordingcategoriess->id || $timerecordingcategoriess->id != $id) {
$this->layout()->setFlash("Zeiterfassung Kategorie nicht gefunden.", "error");
$this->redirect("TimerecordingCategory");
}
$timerecordingcategoriess->delete();
$this->redirect("TimerecordingCategory");
}
}

View File

@@ -0,0 +1,132 @@
<?php
class TimerecordingCategoryModel
{
private $name;
private $short;
private $hourday;
private $approval;
private $require_comment;
public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum");
public static $approval_definition = array(0 => "Nein", 1 => "Ja");
public static $require_comment_definition = array(0 => "Nein", 1 => "Ja");
public static function find($data)
{
}
public static function create(array $data)
{
$model = new TimerecordingCategory();
foreach ($data as $field => $value) {
if (property_exists(get_called_class(), $field)) {
if (substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
}
$model->$field = $value;
}
}
$me = mfValuecache::singleton()->get("me");
if (!$me) {
$me = new User();
$me->loadMe();
mfValuecache::singleton()->set("me", $me);
}
if ($model->create_by === null) {
$model->create_by = $me->id;
}
if ($model->edit_by === null) {
$model->edit_by = $me->id;
}
return $model;
}
public static function getOne($id)
{
if (!is_numeric($id) || !$id) {
throw new Exception("Invalid number", 400);
}
$item = [];
$db = FronkDB::singleton();
$res = $db->select("timerecordingCategory", "*", "id=$id LIMIT 1");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new TimerecordingCategory($data);
}
return $item;
}
public static function getAll()
{
$items = [];
$db = FronkDB::singleton();
$res = $db->select("TimerecordingCategory", "*", "1=1");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new TimerecordingCategory($data);
}
}
return $items;
}
public static function getFirst()
{
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("TimerecordingCategory", "*", "$where ");
if ($db->num_rows($res)) {
$data = $db->fetch_object($res);
$item = new TimerecordingCategory($data);
if ($item->id) {
return $item;
} else {
return null;
}
}
return null;
}
public static function search($filter)
{
$items = [];
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("TimerecordingCategory", "*", "$where");
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$items[] = new TimerecordingCategory($data);
}
}
return $items;
}
private static function getSqlFilter($filter)
{
$where = "1=1 ";
//var_dump($filter);exit;
if (array_key_exists("network_id", $filter)) {
$networkid = $filter['network_id'];
if (is_numeric($networkid)) {
$where .= " AND network_id=$networkid";
}
}
//var_dump($filter, $where);exit;
return $where;
}
}

View File

@@ -0,0 +1,62 @@
<?php
class TimerecordingPermitController extends mfBaseController
{
protected function init()
{
$this->needlogin = true;
$me = new User();
$me->loadMe();
$this->me = $me;
$this->layout()->set("me", $me);
if (!$me->can(["Fibu"])) {
$this->redirect("Dashboard");
}
}
protected function indexAction()
{
$this->layout()->setTemplate("TimerecordingPermit/Index");
$timerecordingCategoriess = TimerecordingCategoryModel::getAll();
$this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess);
$timerecordings = TimerecordingModel::getAllPermits();
$this->layout()->set("timerecordings", $timerecordings);
}
protected function addAction()
{
}
protected function editAction()
{
}
protected function saveAction()
{
}
protected function approveAction()
{
$id = $this->request->id;
$timerecordings = new Timerecording($id);
if (!$timerecordings->id || $timerecordings->id != $id) {
$this->layout()->setFlash("Buchung nicht gefunden.", "error");
$this->redirect("TimerecordingPermit");
}
$data = [];
$data['approved'] = 1;
$timerecordings->update($data);
$timerecordings->save();
$this->redirect("TimerecordingPermit");
}
}

View File

@@ -0,0 +1,51 @@
<?php
class TimerecordingReportController extends mfBaseController
{
protected function init()
{
$this->needlogin = true;
$me = new User();
$me->loadMe();
$this->me = $me;
$this->layout()->set("me", $me);
if (!$me->can(["Fibu"])) {
$this->redirect("Dashboard");
}
}
protected function indexAction()
{
$this->layout()->setTemplate("TimerecordingReport/Index");
$timerecordingCategoriess = TimerecordingCategoryModel::getAll();
$this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess);
$timerecordings = TimerecordingModel::getAll();
$this->layout()->set("timerecordings", $timerecordings);
}
protected function addAction()
{
}
protected function editAction()
{
}
protected function saveAction()
{
}
protected function deleteAction()
{
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class Poprackmodulepatch extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$poprackmodulepatch = $this->table("Poprackmodulepatch", ['signed' => true]);
$poprackmodulepatch->addColumn("poprackmodule_id", "integer", ["null" => false]);
$poprackmodulepatch->addColumn("port", "integer", ["null" => false])->addIndex(['port']);
$poprackmodulepatch->addColumn("fiberPlanCable_id", "integer", ["null" => true, "default" => null])->addIndex(['fiberPlanCable_id']);
$poprackmodulepatch->addColumn("destination", "integer", ["null" => true, "default" => null, "comment" => "1:startpoint/2:endpoint"]);
$poprackmodulepatch->addColumn("create_by", "integer", ["null" => false]);
$poprackmodulepatch->addColumn("edit_by", "integer", ["null" => false]);
$poprackmodulepatch->addColumn("create", "integer", ["null" => false]);
$poprackmodulepatch->addColumn("edit", "integer", ["null" => false]);
$poprackmodulepatch->save();
$poprackmodulepatch = $this->table("Poprackmodulepatch");
$poprackmodulepatch->addForeignKey('poprackmodule_id', 'Poprackmodule', ['id'],['delete'=> 'CASCADE', 'update'=> 'RESTRICT','constraint' => 'poprackmodule_id']);
$poprackmodulepatch->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Poprackmodulepatch")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PopNetwork extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$popnetwork = $this->table("PopNetwork", ['signed' => true]);
$popnetwork->addColumn("pop_id", "integer", ["null" => false])->addIndex(['pop_id']);
$popnetwork->addColumn("network_id", "integer", ["null" => false])->addIndex(['network_id']);
$popnetwork->addColumn("create_by", "integer", ["null" => false]);
$popnetwork->addColumn("edit_by", "integer", ["null" => false]);
$popnetwork->addColumn("create", "integer", ["null" => false]);
$popnetwork->addColumn("edit", "integer", ["null" => false]);
$popnetwork->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("PopNetwork")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
use Phinx\Util\Literal;
final class Timerecording extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$timerecording = $this->table("Timerecording", ["signed" => true]);
$timerecording->addColumn("user_id", "integer", ["null" => false])->addIndex(["user_id"]);
$timerecording->addColumn("start", "integer", ["null" => true]);
$timerecording->addColumn("end", "integer", ["null" => true]);
$timerecording->addColumn("timerecordingCategory_id", "integer", ["null" => false]);
$timerecording->addColumn("commend", "text", ["null" => true]);
$timerecording->addColumn("approved", "integer", ["null" => false, "default" => "0"]);
$timerecording->addColumn("completed", "integer", ["null" => false, "default" => "0"]);
$timerecording->addColumn("create_by", "integer", ["null" => false]);
$timerecording->addColumn("edit_by", "integer", ["null" => false]);
$timerecording->addColumn("create", "integer", ["null" => false]);
$timerecording->addColumn("edit", "integer", ["null" => false]);
$timerecording->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("Timerecording")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingCategory extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$timerecordingCategory = $this->table("TimerecordingCategory", ["signed" => true]);
$timerecordingCategory->addColumn("name", "text", ["null" => false]);
$timerecordingCategory->addColumn("short", "string", ["null" => true, "limit" => 64]);
$timerecordingCategory->addColumn("hourday", "integer", ["null" => false, "default" => "1", "comment" => "1:Stunden/2:Tage/3:Startdatum/4:Enddatum"]);
$timerecordingCategory->addColumn("approval", "integer", ["null" => false, "default" => "0"]);
$timerecordingCategory->addColumn("require_comment", "integer", ["null" => false, "default" => "0"]);
$timerecordingCategory->addColumn("create_by", "integer", ["null" => false]);
$timerecordingCategory->addColumn("edit_by", "integer", ["null" => false]);
$timerecordingCategory->addColumn("create", "integer", ["null" => false]);
$timerecordingCategory->addColumn("edit", "integer", ["null" => false]);
$timerecordingCategory->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("TimerecordingCategory")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -442,7 +442,12 @@ Responsive Menu
background-color: #fff; }
#navigation.open {
display: block;
overflow-y: auto; } }
overflow-y: auto; }
.mobile-hide
{
display:none !important;
}
}
@media (max-height: 375px) {
.navigation-menu {
@@ -1982,3 +1987,7 @@ body.authentication-bg {
.social-links li a:hover {
color: #6c757d;
border-color: #6c757d; }
.d-lg-list-item
{
display: list-item;
}

View File

@@ -15,6 +15,20 @@
float: right;
}
table.dataTable > tbody > tr.child ul.dtr-details {
width: 100%;
}
table.dataTable > tbody > tr.child span.dtr-title {
display: table-row;
}
table.dataTable > tbody > tr.child span.dtr-data {
display: table-cell;
text-wrap: wrap;
}
.clear-fa {
margin-left: 5px;
font-size: 23px;
@@ -87,21 +101,144 @@
.w-30 {
width: 33% !important;
}
.fa-ban
{
.fa-ban {
color: #0151e7;
font-size: 15px;
}
.fa-circle-check
{
.fa-circle-check {
color: #23b900;
font-size: 15px;
}
.fa-circle-xmark
{
.fa-circle-xmark {
color: #f1556c;
font-size: 15px;
}
table.dataTable.table-sm>thead>tr>th:not(.sorting_disabled) {
padding-right:.85rem ;
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: .85rem;
}
.mobile {
width: unset;
display: table-cell;
}
.deny-button
{
color: #f00;
}
@media (max-width: 1200px) {
.fa-circle-xmark, .fa-ban, .fa-trash, .fa-edit, .fa-square-check, .fa-arrows-up-down-left-right {
font-size: 25px;
}
.fa-trash, .deny-button {
float: right;
}
.mobile {
width: 0px;
display: none;
}
.card-body {
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
}
.form-control {
margin-top: 4px;
}
.alert {
margin-top: 4px;
text-align: center;
}
.check-button {
margin-top: 20px;
}
#filterrow {
display: none;
}
#datatable {
width: 100% !important;
}
li.paginate_button.previous, li.paginate_button.next {
display: inline-block;
font-size: 1.0rem;
}
.dataTables_length .form-select {
margin-right: 0px;
padding: 4px 7px;
font-size: .875rem;
}
div.dataTables_wrapper div.dataTables_filter input {
margin-left: 0.5em;
display: inline-block;
/* width: auto; */
width: 150px;
}
.dataTables_length {
margin-top: 4px;
}
.header-title {
font-size: 14px;
margin: 12px 3px 7px 0px;
}
}
table.dataTable > tbody > tr.child span.dtr-data {
text-wrap: wrap;
display: inline-block;
width: 100%;
}
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: 1.5rem;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before, table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
content: "▼";
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before, table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
margin-right: 0.5em;
display: inline-block;
color: rgba(0, 0, 0, 0.5);
content: "►";
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before, table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
background-color: unset;
top: 0.85rem;
}
.dataTables_length .form-select {
margin-right: 10px;
padding: 4px 7px;
font-size: .875rem;
font-weight: 400;
line-height: 1.5;
color: #6c757d;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.2rem;
-webkit-transition: border-color .15s ease-in-out, -webkit-box-shadow .15s ease-in-out;
transition: border-color .15s ease-in-out, -webkit-box-shadow .15s ease-in-out;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out, -webkit-box-shadow .15s ease-in-out;
}

View File

@@ -38,18 +38,21 @@ $('#filterrow th').each(function (i) {
});
table = $('#datatable').DataTable({
responsive: true,
buttons: [
{
extend: 'excelHtml5',
text: 'XLSX Export',
className: 'btn-success margina'
className: 'btn-success margina d-none d-lg-block',
exportOptions: {
columns: ['th:not(:last-child)']
}
}
], columnDefs: [
columndefs
],
"language": {
"url": "/datatables/json/german.json"
"url": "/datatables/json/german.json?v1"
},
orderCellsTop: true,
stateSave: true,

View File

@@ -4,17 +4,24 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
* https://datatables.net/download/#bs4/jszip-2.5.0/pdfmake-0.1.36/dt-1.13.2/b-2.3.4/b-html5-2.3.4
* https://datatables.net/download/#bs5/jszip-3.10.1/pdfmake-0.2.7/dt-1.13.8/b-2.4.2/b-html5-2.4.2/b-print-2.4.2/r-2.5.0
*
* Included libraries:
* JSZip 2.5.0, pdfmake 0.1.36, DataTables 1.13.2, Buttons 2.3.4, HTML5 export 2.3.4
* JSZip 3.10.1, pdfmake 0.2.7, DataTables 1.13.8, Buttons 2.4.2, HTML5 export 2.4.2, Print view 2.4.2, Responsive 2.5.0
*/
@charset "UTF-8";
:root {
--dt-row-selected: 2, 117, 216;
--dt-row-selected: 13, 110, 253;
--dt-row-selected-text: 255, 255, 255;
--dt-row-selected-link: 9, 10, 11;
--dt-row-stripe: 0, 0, 0;
--dt-row-hover: 0, 0, 0;
--dt-column-ordering: 0, 0, 0;
--dt-html-background: white;
}
:root.dark {
--dt-html-background: rgb(33, 37, 41);
}
table.dataTable td.dt-control {
@@ -22,25 +29,19 @@ table.dataTable td.dt-control {
cursor: pointer;
}
table.dataTable td.dt-control:before {
height: 1em;
width: 1em;
margin-top: -9px;
display: inline-block;
color: white;
border: 0.15em solid white;
border-radius: 1em;
box-shadow: 0 0 0.2em #444;
box-sizing: content-box;
text-align: center;
text-indent: 0 !important;
font-family: "Courier New", Courier, monospace;
line-height: 1em;
content: "+";
background-color: #31b131;
color: rgba(0, 0, 0, 0.5);
content: "▶";
}
table.dataTable tr.dt-hasChild td.dt-control:before {
content: "-";
background-color: #d33333;
content: "";
}
html.dark table.dataTable td.dt-control:before {
color: rgba(255, 255, 255, 0.5);
}
html.dark table.dataTable tr.dt-hasChild td.dt-control:before {
color: rgba(255, 255, 255, 0.5);
}
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
@@ -79,6 +80,7 @@ table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:before {
bottom: 50%;
content: "▲";
content: "▲"/"";
}
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:after,
@@ -88,6 +90,7 @@ table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
top: 50%;
content: "▼";
content: "▼"/"";
}
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc:before,
@@ -104,9 +107,9 @@ table.dataTable thead > tr > td:active {
outline: none;
}
div.dataTables_scrollBody table.dataTable thead > tr > th:before, div.dataTables_scrollBody table.dataTable thead > tr > th:after,
div.dataTables_scrollBody table.dataTable thead > tr > td:before,
div.dataTables_scrollBody table.dataTable thead > tr > td:after {
div.dataTables_scrollBody > table.dataTable > thead > tr > th:before, div.dataTables_scrollBody > table.dataTable > thead > tr > th:after,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:before,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:after {
display: none;
}
@@ -119,6 +122,7 @@ div.dataTables_processing {
margin-top: -26px;
text-align: center;
padding: 2px;
z-index: 10;
}
div.dataTables_processing > div:last-child {
position: relative;
@@ -132,7 +136,8 @@ div.dataTables_processing > div:last-child > div {
width: 13px;
height: 13px;
border-radius: 50%;
background: 2 117 216;
background: rgb(13, 110, 253);
background: rgb(var(--dt-row-selected));
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
div.dataTables_processing > div:last-child > div:nth-child(1) {
@@ -257,6 +262,11 @@ table.dataTable tbody td.dt-body-nowrap {
white-space: nowrap;
}
/*! Bootstrap 5 integration for DataTables
*
* ©2020 SpryMedia Ltd, all rights reserved.
* License: MIT datatables.net/license/mit
*/
table.dataTable {
clear: both;
margin-top: 6px !important;
@@ -278,14 +288,14 @@ table.dataTable.nowrap th,
table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) {
background-color: transparent;
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * {
box-shadow: none;
}
table.dataTable > tbody > tr {
background-color: transparent;
}
table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px rgb(2, 117, 216);
box-shadow: inset 0 0 0 9999px rgb(13, 110, 253);
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected));
color: rgb(255, 255, 255);
color: rgb(var(--dt-row-selected-text));
@@ -294,18 +304,18 @@ table.dataTable > tbody > tr.selected a {
color: rgb(9, 10, 11);
color: rgb(var(--dt-row-selected-link));
}
table.dataTable.table-striped > tbody > tr.odd > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.05);
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * {
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-stripe), 0.05);
}
table.dataTable.table-striped > tbody > tr.odd.selected > * {
box-shadow: inset 0 0 0 9999px rgba(2, 117, 216, 0.95);
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1).selected > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.95);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.95);
}
table.dataTable.table-hover > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-hover), 0.075);
}
table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(2, 117, 216, 0.975);
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.975);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975);
}
@@ -344,15 +354,8 @@ div.dataTables_wrapper div.dataTables_paginate ul.pagination {
white-space: nowrap;
justify-content: flex-end;
}
div.dataTables_wrapper div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 1em 0;
div.dataTables_wrapper div.dt-row {
position: relative;
}
div.dataTables_scrollHead table.dataTable {
@@ -399,22 +402,34 @@ div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: 20px;
}
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled):before, table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled):after {
right: 5px;
}
table.table-bordered.dataTable {
border-right-width: 0;
}
table.table-bordered.dataTable thead tr:first-child th,
table.table-bordered.dataTable thead tr:first-child td {
border-top-width: 1px;
}
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
border-left-width: 0;
}
table.table-bordered.dataTable th:first-child, table.table-bordered.dataTable th:first-child,
table.table-bordered.dataTable td:first-child,
table.table-bordered.dataTable td:first-child {
border-left-width: 1px;
}
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
table.table-bordered.dataTable td:last-child,
table.table-bordered.dataTable td:last-child {
border-right-width: 1px;
}
table.table-bordered.dataTable tbody th,
table.table-bordered.dataTable tbody td {
border-bottom-width: 0;
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
border-bottom-width: 1px;
}
div.dataTables_scrollHead table.table-bordered {
@@ -431,6 +446,12 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-
padding-right: 0;
}
:root[data-bs-theme=dark] {
--dt-row-hover: 255, 255, 255;
--dt-row-stripe: 255, 255, 255;
--dt-column-ordering: 255, 255, 255;
}
@keyframes dtb-spinner {
100% {
@@ -481,31 +502,27 @@ div.dt-button-info {
margin-top: -100px;
margin-left: -200px;
background-color: white;
border: 2px solid #111;
box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.3);
border-radius: 3px;
border-radius: 0.75em;
box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.8);
text-align: center;
z-index: 21;
z-index: 2003;
overflow: hidden;
}
div.dt-button-info h2 {
padding: 0.5em;
padding: 2rem 2rem 1rem 2rem;
margin: 0;
font-weight: normal;
border-bottom: 1px solid #ddd;
background-color: #f3f3f3;
}
div.dt-button-info > div {
padding: 1em;
padding: 1em 2em 2em 2em;
}
div.dtb-popover-close {
position: absolute;
top: 10px;
right: 10px;
top: 6px;
right: 6px;
width: 22px;
height: 22px;
border: 1px solid #eaeaea;
background-color: #f9f9f9;
text-align: center;
border-radius: 3px;
cursor: pointer;
@@ -544,6 +561,46 @@ span.dt-button-spacer.bar:empty {
padding-left: 0;
}
div.dt-button-collection .dt-button-active {
padding-right: 3em;
}
div.dt-button-collection .dt-button-active:after {
position: absolute;
top: 50%;
margin-top: -10px;
right: 1em;
display: inline-block;
content: "✓";
color: inherit;
}
div.dt-button-collection .dt-button-active.dt-button-split {
padding-right: 0;
}
div.dt-button-collection .dt-button-active.dt-button-split:after {
display: none;
}
div.dt-button-collection .dt-button-active.dt-button-split > *:first-child {
padding-right: 3em;
}
div.dt-button-collection .dt-button-active.dt-button-split > *:first-child:after {
position: absolute;
top: 50%;
margin-top: -10px;
right: 1em;
display: inline-block;
content: "✓";
color: inherit;
}
div.dt-button-collection .dt-button-active-a a {
padding-right: 3em;
}
div.dt-button-collection .dt-button-active-a a:after {
position: absolute;
right: 1em;
display: inline-block;
content: "✓";
color: inherit;
}
div.dt-button-collection span.dt-button-spacer {
width: 100%;
font-size: 0.9em;
@@ -556,32 +613,55 @@ div.dt-button-collection span.dt-button-spacer:empty {
}
div.dt-button-collection span.dt-button-spacer.bar {
border-left: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
padding-left: 0;
}
div.dt-button-collection {
position: absolute;
z-index: 2001;
background-color: white;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
padding: 0.5rem;
width: 218px;
html.dark div.dt-button-info {
background-color: var(--dt-html-background);
border: 1px solid rgba(255, 255, 255, 0.15);
}
div.dt-button-collection div.dropdown-menu {
div.dt-buttons div.btn-group {
position: initial;
}
div.dt-buttons div.dropdown-menu {
margin-top: 4px;
}
div.dt-buttons div.dropdown-menu .dt-button {
position: relative;
display: block;
z-index: 2002;
min-width: 100%;
background-color: transparent;
border: none;
box-shadow: none;
padding: 0;
border-radius: 0;
}
div.dt-button-collection.fixed {
div.dt-buttons div.dropdown-menu div.dt-button-split {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: stretch;
}
div.dt-buttons div.dropdown-menu div.dt-button-split a:first-child {
min-width: auto;
flex: 1 0 50px;
padding-right: 0;
}
div.dt-buttons div.dropdown-menu div.dt-button-split button:last-child {
min-width: 33px;
flex: 0;
background: transparent;
border: none;
line-height: 1rem;
color: var(--bs-dropdown-link-color);
padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
}
div.dt-buttons div.dropdown-menu div.dt-button-split button:last-child:hover {
color: var(--bs-dropdown-link-hover-color);
background-color: var(--bs-dropdown-link-hover-bg);
}
div.dt-buttons div.dropdown-menu div.dt-button-split button:last-child:after {
position: relative;
left: -3px;
}
div.dt-buttons div.dropdown-menu.fixed {
position: fixed;
display: block;
top: 50%;
@@ -589,39 +669,40 @@ div.dt-button-collection.fixed {
margin-left: -75px;
border-radius: 5px;
background-color: white;
padding: 0.5em;
}
div.dt-button-collection.fixed.two-column {
div.dt-buttons div.dropdown-menu.fixed.two-column {
margin-left: -200px;
}
div.dt-button-collection.fixed.three-column {
div.dt-buttons div.dropdown-menu.fixed.three-column {
margin-left: -225px;
}
div.dt-button-collection.fixed.four-column {
div.dt-buttons div.dropdown-menu.fixed.four-column {
margin-left: -300px;
}
div.dt-button-collection.fixed.columns {
div.dt-buttons div.dropdown-menu.fixed.columns {
margin-left: -409px;
}
@media screen and (max-width: 1024px) {
div.dt-button-collection.fixed.columns {
div.dt-buttons div.dropdown-menu.fixed.columns {
margin-left: -308px;
}
}
@media screen and (max-width: 640px) {
div.dt-button-collection.fixed.columns {
div.dt-buttons div.dropdown-menu.fixed.columns {
margin-left: -203px;
}
}
@media screen and (max-width: 460px) {
div.dt-button-collection.fixed.columns {
div.dt-buttons div.dropdown-menu.fixed.columns {
margin-left: -100px;
}
}
div.dt-button-collection.fixed > :last-child {
div.dt-buttons div.dropdown-menu.fixed > :last-child {
max-height: 100vh;
overflow: auto;
}
div.dt-button-collection.two-column > :last-child, div.dt-button-collection.three-column > :last-child, div.dt-button-collection.four-column > :last-child {
div.dt-buttons div.dropdown-menu.two-column > :last-child, div.dt-buttons div.dropdown-menu.three-column > :last-child, div.dt-buttons div.dropdown-menu.four-column > :last-child {
display: block !important;
-webkit-column-gap: 8px;
-moz-column-gap: 8px;
@@ -629,38 +710,38 @@ div.dt-button-collection.two-column > :last-child, div.dt-button-collection.thre
-o-column-gap: 8px;
column-gap: 8px;
}
div.dt-button-collection.two-column > :last-child > *, div.dt-button-collection.three-column > :last-child > *, div.dt-button-collection.four-column > :last-child > * {
div.dt-buttons div.dropdown-menu.two-column > :last-child > *, div.dt-buttons div.dropdown-menu.three-column > :last-child > *, div.dt-buttons div.dropdown-menu.four-column > :last-child > * {
-webkit-column-break-inside: avoid;
break-inside: avoid;
}
div.dt-button-collection.two-column {
div.dt-buttons div.dropdown-menu.two-column {
width: 400px;
}
div.dt-button-collection.two-column > :last-child {
div.dt-buttons div.dropdown-menu.two-column > :last-child {
padding-bottom: 1px;
column-count: 2;
}
div.dt-button-collection.three-column {
div.dt-buttons div.dropdown-menu.three-column {
width: 450px;
}
div.dt-button-collection.three-column > :last-child {
div.dt-buttons div.dropdown-menu.three-column > :last-child {
padding-bottom: 1px;
column-count: 3;
}
div.dt-button-collection.four-column {
div.dt-buttons div.dropdown-menu.four-column {
width: 600px;
}
div.dt-button-collection.four-column > :last-child {
div.dt-buttons div.dropdown-menu.four-column > :last-child {
padding-bottom: 1px;
column-count: 4;
}
div.dt-button-collection .dt-button {
div.dt-buttons div.dropdown-menu .dt-button {
border-radius: 0;
}
div.dt-button-collection.columns {
div.dt-buttons div.dropdown-menu.columns {
width: auto;
}
div.dt-button-collection.columns > :last-child {
div.dt-buttons div.dropdown-menu.columns > :last-child {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
@@ -669,73 +750,69 @@ div.dt-button-collection.columns > :last-child {
width: 818px;
padding-bottom: 1px;
}
div.dt-button-collection.columns > :last-child .dt-button {
div.dt-buttons div.dropdown-menu.columns > :last-child .dt-button {
min-width: 200px;
flex: 0 1;
margin: 0;
}
div.dt-button-collection.columns.dtb-b3 > :last-child, div.dt-button-collection.columns.dtb-b2 > :last-child, div.dt-button-collection.columns.dtb-b1 > :last-child {
div.dt-buttons div.dropdown-menu.columns.dtb-b3 > :last-child, div.dt-buttons div.dropdown-menu.columns.dtb-b2 > :last-child, div.dt-buttons div.dropdown-menu.columns.dtb-b1 > :last-child {
justify-content: space-between;
}
div.dt-button-collection.columns.dtb-b3 .dt-button {
div.dt-buttons div.dropdown-menu.columns.dtb-b3 .dt-button {
flex: 1 1 32%;
}
div.dt-button-collection.columns.dtb-b2 .dt-button {
div.dt-buttons div.dropdown-menu.columns.dtb-b2 .dt-button {
flex: 1 1 48%;
}
div.dt-button-collection.columns.dtb-b1 .dt-button {
div.dt-buttons div.dropdown-menu.columns.dtb-b1 .dt-button {
flex: 1 1 100%;
}
@media screen and (max-width: 1024px) {
div.dt-button-collection.columns > :last-child {
div.dt-buttons div.dropdown-menu.columns > :last-child {
width: 612px;
}
}
@media screen and (max-width: 640px) {
div.dt-button-collection.columns > :last-child {
div.dt-buttons div.dropdown-menu.columns > :last-child {
width: 406px;
}
div.dt-button-collection.columns.dtb-b3 .dt-button {
div.dt-buttons div.dropdown-menu.columns.dtb-b3 .dt-button {
flex: 0 1 32%;
}
}
@media screen and (max-width: 460px) {
div.dt-button-collection.columns > :last-child {
div.dt-buttons div.dropdown-menu.columns > :last-child {
width: 200px;
}
}
div.dt-button-collection.fixed:before, div.dt-button-collection.fixed:after {
display: none;
div.dt-buttons span.dt-button-spacer.empty {
margin: 1px;
}
div.dt-button-collection .btn-group {
flex: 1 1 auto;
div.dt-buttons span.dt-button-spacer.bar:empty {
height: inherit;
}
div.dt-button-collection .dt-button {
min-width: 200px;
div.dt-buttons .btn.processing {
color: rgba(0, 0, 0, 0.2);
}
div.dt-button-collection div.dt-btn-split-wrapper {
width: 100%;
padding-left: 5px;
padding-right: 5px;
}
div.dt-button-collection button.dt-btn-split-drop-button {
width: 100%;
color: #212529;
border: none;
background-color: white;
border-radius: 0px;
margin-left: 0px !important;
}
div.dt-button-collection button.dt-btn-split-drop-button:focus {
border: none;
border-radius: 0px;
outline: none;
}
div.dt-button-collection button.dt-btn-split-drop-button:hover {
background-color: #e9ecef;
}
div.dt-button-collection button.dt-btn-split-drop-button:active {
background-color: #007bff !important;
div.dt-buttons .btn.processing:after {
position: absolute;
top: 50%;
left: 50%;
width: 16px;
height: 16px;
margin: -8px 0 0 -8px;
box-sizing: border-box;
display: block;
content: " ";
border: 2px solid rgb(40, 40, 40);
border-radius: 50%;
border-left-color: transparent;
border-right-color: transparent;
animation: dtb-spinner 1500ms infinite linear;
-o-animation: dtb-spinner 1500ms infinite linear;
-ms-animation: dtb-spinner 1500ms infinite linear;
-webkit-animation: dtb-spinner 1500ms infinite linear;
-moz-animation: dtb-spinner 1500ms infinite linear;
}
div.dt-button-background {
@@ -758,109 +835,180 @@ div.dt-button-background {
float: none;
}
}
div.dt-buttons button.btn.processing,
div.dt-buttons div.btn.processing,
div.dt-buttons a.btn.processing {
color: rgba(0, 0, 0, 0.2);
:root[data-bs-theme=dark] div.dropdown-menu.dt-button-collection.fixed {
background-color: rgb(33, 37, 41);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 8px;
}
div.dt-buttons button.btn.processing:after,
div.dt-buttons div.btn.processing:after,
div.dt-buttons a.btn.processing:after {
position: absolute;
top: 50%;
left: 50%;
width: 16px;
height: 16px;
margin: -8px 0 0 -8px;
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty {
cursor: default !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty:before {
display: none !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
cursor: pointer;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
margin-right: 0.5em;
display: inline-block;
color: rgba(0, 0, 0, 0.5);
content: "►";
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control.arrow-right::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control.arrow-right::before {
content: "◄";
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
content: "▼";
}
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control {
padding-left: 0.333em;
}
table.dataTable.dtr-column > tbody > tr > td.dtr-control,
table.dataTable.dtr-column > tbody > tr > th.dtr-control,
table.dataTable.dtr-column > tbody > tr > td.control,
table.dataTable.dtr-column > tbody > tr > th.control {
cursor: pointer;
}
table.dataTable.dtr-column > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr > th.dtr-control:before,
table.dataTable.dtr-column > tbody > tr > td.control:before,
table.dataTable.dtr-column > tbody > tr > th.control:before {
display: inline-block;
color: rgba(0, 0, 0, 0.5);
content: "►";
}
table.dataTable.dtr-column > tbody > tr > td.dtr-control.arrow-right::before,
table.dataTable.dtr-column > tbody > tr > th.dtr-control.arrow-right::before,
table.dataTable.dtr-column > tbody > tr > td.control.arrow-right::before,
table.dataTable.dtr-column > tbody > tr > th.control.arrow-right::before {
content: "◄";
}
table.dataTable.dtr-column > tbody > tr.parent td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.parent th.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.parent td.control:before,
table.dataTable.dtr-column > tbody > tr.parent th.control:before {
content: "▼";
}
table.dataTable > tbody > tr.child {
padding: 0.5em 1em;
}
table.dataTable > tbody > tr.child:hover {
background: transparent !important;
}
table.dataTable > tbody > tr.child ul.dtr-details {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details > li {
border-bottom: 1px solid #efefef;
padding: 0.5em 0;
}
table.dataTable > tbody > tr.child ul.dtr-details > li:first-child {
padding-top: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
padding-bottom: 0;
border-bottom: none;
}
table.dataTable > tbody > tr.child span.dtr-title {
display: inline-block;
min-width: 75px;
font-weight: bold;
}
div.dtr-modal {
position: fixed;
box-sizing: border-box;
display: block;
content: " ";
border: 2px solid rgb(40, 40, 40);
border-radius: 50%;
border-left-color: transparent;
border-right-color: transparent;
animation: dtb-spinner 1500ms infinite linear;
-o-animation: dtb-spinner 1500ms infinite linear;
-ms-animation: dtb-spinner 1500ms infinite linear;
-webkit-animation: dtb-spinner 1500ms infinite linear;
-moz-animation: dtb-spinner 1500ms infinite linear;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 100;
padding: 10em 1em;
}
div.dt-buttons div.btn-group {
position: initial;
div.dtr-modal div.dtr-modal-display {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 50%;
height: fit-content;
max-height: 75%;
overflow: auto;
margin: auto;
z-index: 102;
overflow: auto;
background-color: #f5f5f7;
border: 1px solid black;
border-radius: 0.5em;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
div.dtr-modal div.dtr-modal-content {
position: relative;
padding: 2.5em;
}
div.dtr-modal div.dtr-modal-content h2 {
margin-top: 0;
}
div.dtr-modal div.dtr-modal-close {
position: absolute;
top: 6px;
right: 6px;
width: 22px;
height: 22px;
text-align: center;
border-radius: 3px;
cursor: pointer;
z-index: 12;
}
div.dtr-modal div.dtr-modal-background {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 101;
background: rgba(0, 0, 0, 0.6);
}
div.dt-btn-split-wrapper:active:not(.disabled) button, div.dt-btn-split-wrapper.active:not(.disabled) button {
background-color: #5a6268;
border-color: #545b62;
@media screen and (max-width: 767px) {
div.dtr-modal div.dtr-modal-display {
width: 95%;
}
}
div.dt-btn-split-wrapper:active:not(.disabled) button.dt-btn-split-drop, div.dt-btn-split-wrapper.active:not(.disabled) button.dt-btn-split-drop {
box-shadow: none;
background-color: #6c757d;
border-color: #6c757d;
html.dark table.dataTable > tbody > tr > td.dtr-control:before {
color: rgba(255, 255, 255, 0.5) !important;
}
div.dt-btn-split-wrapper:active:not(.disabled) button:hover, div.dt-btn-split-wrapper.active:not(.disabled) button:hover {
background-color: #5a6268;
border-color: #545b62;
html.dark table.dataTable > tbody > tr.child ul.dtr-details > li {
border-bottom-color: rgb(64, 67, 70);
}
html.dark div.dtr-modal div.dtr-modal-display {
background-color: rgb(33, 37, 41);
border: 1px solid rgba(255, 255, 255, 0.15);
}
div.dataTables_wrapper div.dt-buttons.btn-group div.btn-group {
border-radius: 4px !important;
}
div.dataTables_wrapper div.dt-buttons.btn-group div.btn-group:last-child {
border-top-left-radius: 0px !important;
border-bottom-left-radius: 0px !important;
}
div.dataTables_wrapper div.dt-buttons.btn-group div.btn-group:first-child {
border-top-right-radius: 0px !important;
border-bottom-right-radius: 0px !important;
}
div.dataTables_wrapper div.dt-buttons.btn-group div.btn-group:last-child:first-child {
border-top-left-radius: 4px !important;
border-bottom-left-radius: 4px !important;
border-top-right-radius: 4px !important;
border-bottom-right-radius: 4px !important;
}
div.dataTables_wrapper div.dt-buttons.btn-group div.btn-group button.dt-btn-split-drop:last-child {
border: 1px solid rgb(108, 117, 125);
}
div.dataTables_wrapper div.dt-buttons.btn-group div.btn-group div.dt-btn-split-wrapper {
border: none;
div.dtr-bs-modal table.table tr:first-child td {
border-top: none;
}
div.dt-button-collection div.btn-group {
border-radius: 4px !important;
}
div.dt-button-collection div.btn-group button {
border-radius: 4px;
}
div.dt-button-collection div.btn-group button:last-child {
border-top-left-radius: 0px !important;
border-bottom-left-radius: 0px !important;
}
div.dt-button-collection div.btn-group button:first-child {
border-top-right-radius: 0px !important;
border-bottom-right-radius: 0px !important;
}
div.dt-button-collection div.btn-group button:last-child:first-child {
border-top-left-radius: 4px !important;
border-bottom-left-radius: 4px !important;
border-top-right-radius: 4px !important;
border-bottom-right-radius: 4px !important;
}
div.dt-button-collection div.btn-group button.dt-btn-split-drop:last-child {
border: 1px solid rgb(108, 117, 125);
}
div.dt-button-collection div.btn-group div.dt-btn-split-wrapper {
border: none;
}
span.dt-button-spacer.bar:empty {
height: inherit;
}
div.dt-button-collection span.dt-button-spacer {
padding-left: 1rem !important;
text-align: left;
table.dataTable.table-bordered th.dtr-control.dtr-hidden + *,
table.dataTable.table-bordered td.dtr-control.dtr-hidden + * {
border-left-width: 1px;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,7 @@
"sInfoFiltered": "(gefiltert von _MAX_ Einträgen)",
"sInfoPostFix": "",
"sInfoThousands": ".",
"sLengthMenu": "_MENU_ Einträge anzeigen",
"sLengthMenu": "_MENU_ <span class=\"d-lg-inline-block d-none\">Einträge anzeigen</span>",
"sLoadingRecords": "Wird geladen...",
"sProcessing": "Bitte warten...",
"sSearch": "Suchen",

View File

@@ -0,0 +1,533 @@
$(document).ready(function () {
if ($('#sortracklist').length > 0) {
Sortable.create(sortracklist, {
handle: '.move-handle',
onEnd: function () {
var popid = $('#sortracklist').data('popid');
var racksortids = [];
$('#sortracklist').find('th').each(function (index, value) {
racksortids.push($(this).data('rackid'));
});
$.post(linkSorTracklist + "&pop_id=" + popid, {
racksortids: racksortids
}, function (data) {
if (data.success === true) {
}
}, "json");
}
});
}
$('#pop-rack-div').show();
$('#rackModal').on('show.bs.modal', function (event) {
var thisclick = $(event.relatedTarget);
var rackhe = thisclick.closest('table').find('th').data('rackhe');
var rackid = thisclick.closest('table').find('th').data('rackid');
var rackname = $.trim(thisclick.closest('table').find('th').text());
var minhe = 1;
var modal = $(this);
var edit = 0;
modal.find('.alert').text('');
modal.find('.alert').hide();
if (rackid === undefined) {
$('#rack-name').val('');
$('#rack-he').val('');
var popid = thisclick.data('popid');
$('#rack-add').data('popid', popid);
$('#rack-update').hide();
$('#rack-remove').hide();
$('#rack-add').show();
} else {
edit = 1;
$('#rack-remove').hide();
$('#rack-add').hide();
$('#rack-update').show();
$('#rack-he').val(rackhe);
$('#rack-name').val(rackname);
for (let i = 1; i <= rackhe; i++) {
if (!thisclick.closest('table').find('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
minhe = i;
}
}
if (minhe === 1) {
$('#rack-remove').data('rackid', rackid);
$('#rack-remove').show();
}
$('#rack-update').data('rackid', rackid);
$('#rack-update').data('rackminhe', minhe);
}
}
)
;
$('#rackModuleModal').on('show.bs.modal', function (event) {
trigger = $(event.relatedTarget);
var destinationname = trigger.closest('table').find('th').text();
var rackhe = trigger.closest('table').find('th').data('rackhe');
var modal = $(this);
modal.find('.modal-title').html('<span id="module-info">Modul (' + destinationname + ')</span>');
modal.find('.alert').text('');
modal.find('.alert').hide();
var options;
var selected;
var hemaxcount = 1;
var hemaxcountactive = 1;
var edit = 0;
var parent = trigger.closest('tr');
if (trigger.closest('tr').find('td').eq(1).html() === undefined) {
edit = 1;
parent = trigger.closest('tr').prev();
for (let i = 1; i <= rackhe; i++) {
if (parent.find('td').eq(1).html() !== undefined) {
break;
} else {
parent = parent.prev();
}
}
}
if (parent.find('td').eq(1).data('id') || parent.find('td').eq(2).data('id') || parent.find('td').eq(3).data('id') || parent.find('td').eq(4).data('id')) {
var counttd = parent.find('td').length - 1;
var newmodule = false;
if (counttd > 1) {
var options;
for (let i = 1; i <= counttd; i++) {
options = options + '<option value="' + i + '">' + i + '</option>';
}
$('#module-slot').html(options);
$('#module-position').html(options);
$('#module-slot-div').show();
}
$('#module-width').attr('disabled', 'disabled');
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control" disabled="disabled"><option value="` + parent.find('td').eq(1).attr('rowspan') + `">` + parent.find('td').eq(1).attr('rowspan') + `</option><select>`);
$('#he-start-div').html(`<select required="required" id="module-he-start" name="module-he-start" class="form-control" disabled="disabled"><option value="` + parent.find('td').eq(0).data('he') + `">` + parent.find('td').eq(0).data('he') + `</option></select>`);
if (parent.find('td').eq(1).data('id') === undefined) {
newmodule = true;
}
var modwidth = 12 / counttd;
$('#module-width').val(modwidth);
if (!newmodule) {
$('#module-remove').show();
$('#module-update').show();
$('#module-add').hide();
$('#module-type').val(parent.find('td').eq(1).data('type')).change();
if ($('#module-type').val() == "1") {
$('#module-device-id').hide();
$('#module-device-text').text(parent.find('td').eq(1).data('name'));
$('#module-device-text').show();
}
if (parent.find('td').eq(1).data('ports') != "") {
$('#module-ports').val(parent.find('td').eq(1).data('ports')).change();
$('#module-plug').val(parent.find('td').eq(1).data('plug'));
}
$('#module-type').attr('disabled', 'disabled');
$('#module-name').val(parent.find('td').eq(1).data('name'));
// $('#module-name').attr('disabled', 'disabled');
$('#module-remove').data('moduleid', parent.find('td').eq(1).data('id'));
$('#module-update').data('moduleid', parent.find('td').eq(1).data('id'));
} else {
$('#module-remove').hide();
$('#module-update').hide();
$('#module-add').show();
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').show();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-type').val('0').change();
$('#module-type').removeAttr('disabled');
$('#module-plug').removeAttr('disabled');
$('#module-ports').removeAttr('disabled');
$('#module-name').val('');
$('#module-ports').val('48');
$('#module-ports').trigger("change");
$('#module-position-div').hide();
$('#module-update').hide();
$('#module-device-text').hide();
}
} else {
$('#module-remove').hide();
$('#module-update').hide();
$('#module-add').show();
for (let i = 1; i <= rackhe; i++) {
if (i == trigger.data('he')) {
selected = 'selected="selected"';
} else {
selected = '';
}
if (trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
options = options + '<option ' + selected + ' value="' + i + '">' + i + '</option>';
}
if (hemaxcountactive == 1 && i > trigger.data('he') && !trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcountactive = 0;
}
if (hemaxcountactive == 1 && i > trigger.data('he') && trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcount++;
}
}
$('#he-start-div').html(`<select required="required" id="module-he-start" name="module-he-start" class="form-control">` + options + `</select>`);
options = "";
selected = "";
for (let i = 1; i <= hemaxcount; i++) {
options = options + '<option ' + selected + ' value="' + i + '">' + i + '</option>';
}
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control">` + options + `</select>`);
if (edit == 0) {
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-type').val('0').change();
$('#module-type').removeAttr('disabled');
$('#module-width').removeAttr('disabled');
$('#module-plug').removeAttr('disabled');
$('#module-ports').removeAttr('disabled');
$('#module-name').val('');
$('#module-width').val('12');
$('#module-ports').val('48');
$('#module-ports').trigger("change");
$('#module-position').empty();
$('#module-position-div').hide();
$('#module-device-text').hide();
$('#module-device-id').show();
}
}
});
$("body").on("change", "#module-type", function () {
if (parseInt($(this).val()) === 1) {
$('#module-name-div').hide();
$('#module-name').attr('disabled', 'disabled');
$('#module-device-div').show();
$('#module-device-id').removeAttr('disabled');
$('#module-ports-div').hide();
$('#module-plug-div').hide();
} else if (parseInt($(this).val()) === 0) {
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-ports-div').show();
$('#module-plug-div').show();
} else {
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-ports-div').hide();
$('#module-plug-div').hide();
}
});
$("body").on("change", "#module-he-start", function () {
var rackhe = trigger.closest('table').find('th').data('rackhe');
var hemaxcount = 1;
var hemaxcountactive = 1
var options;
var selected;
for (let i = 1; i <= rackhe; i++) {
if (hemaxcountactive == 1 && i > $(this).val() && !trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcountactive = 0;
}
if (hemaxcountactive == 1 && i > $(this).val() && trigger.closest('tbody').find('tr').eq(i - 1).find('td').eq(1).hasClass('he-free')) {
hemaxcount++;
}
}
for (let i = 1; i <= hemaxcount; i++) {
options = options + '<option ' + selected + ' value="' + i + '">' + i + '</option>';
}
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control">` + options + `</select>`);
});
$("body").on("click", "#module-add", function () {
var error;
var rackid = trigger.closest('table').find('th').data('rackid');
var endhe = parseInt($.trim($('#module-he-start').val())) + parseInt($.trim($('#module-he-count').val())) - 1;
if (!$.trim($('#module-name').val()) && $.trim($('#module-type').val()) != "1") {
error = "Modul Name darf nicht leer sein";
}
if ($.trim($('#module-type').val()) == "1" && !$.trim($('#module-device-id').val())) {
error = "Kein Device ausgewählt";
}
if (!error) {
$.post(linkAddModule + "&poprack_id=" + rackid, {
type: $.trim($('#module-type').val()),
device_id: $.trim($('#module-device-id').val()),
name: $.trim($('#module-name').val()),
start_he: $.trim($('#module-he-start').val()),
end_he: endhe,
ports: $.trim($('#module-ports').val()),
plug: $.trim($('#module-plug').val()),
width: $.trim($('#module-width').val()),
position: $.trim($('#module-position').val())
}, function (data) {
if (data.success === true) {
$('#rackModuleModal').modal('toggle');
$.get(linkGenerateRack + "&id=" + rackid, function (data, status) {
trigger.closest('tbody').html(data);
});
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#module-remove", function () {
var moduleid = $(this).data('moduleid');
var rackid = trigger.closest('table').find('th').data('rackid');
if (confirm("Modul entfernen?")) {
$.post(linkRemoveModule, {
id: moduleid
}, function (data) {
if (data.success === true) {
$('#rackModuleModal').modal('toggle');
$.get(linkGenerateRack + "&id=" + rackid, function (data, status) {
trigger.closest('tbody').html(data);
});
}
}, "json");
}
});
$("body").on("click", "#module-update", function () {
var moduleid = $(this).data('moduleid');
var rackid = trigger.closest('table').find('th').data('rackid');
var error;
if (!$.trim($('#module-name').val())) {
error = "Modul Name darf nicht leer sein";
}
if (!error) {
$.post(linkUpdateModule, {
id: moduleid,
name: $.trim($('#module-name').val()),
ports: $.trim($('#module-ports').val()),
plug: $.trim($('#module-plug').val())
}, function (data) {
if (data.success === true) {
$('#rackModuleModal').modal('toggle');
$.get(linkGenerateRack + "&id=" + rackid, function (data, status) {
trigger.closest('tbody').html(data);
});
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#rack-update", function () {
var rackid = $(this).data('rackid');
var rackmin = $(this).data('rackminhe');
var error;
if ($('#rack-he').val() < rackmin) {
error = "Minimale Höheneinheiten: " + rackmin;
}
if ($('#rack-he').val() > 60) {
error = "Maximale Höheneinheiten: 60";
}
if (!$.isNumeric($('#rack-he').val())) {
error = "Bitte Zahl bei Höheneinheiten eingeben";
}
if (!$.trim($('#rack-he').val())) {
error = "Höheneinheiten darf nicht leer sein";
}
if (!$.trim($('#rack-name').val())) {
error = "Schrank Name darf nicht leer sein";
}
if (!error) {
$.post(linkEditRack + "&poprack_id=" + rackid, {
name: $.trim($('#rack-name').val()),
he: $.trim($('#rack-he').val())
}, function (data) {
if (data.success === true) {
$('#rackModal').modal('toggle');
location.reload();
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#rack-add", function () {
var popid = $(this).data('popid');
var error;
if ($('#rack-he').val() < 1) {
error = "Minimale Höheneinheiten: " + 1;
}
if ($('#rack-he').val() > 60) {
error = error = "Maximale Höheneinheiten: 60";
}
if (!$.isNumeric($('#rack-he').val())) {
error = "Bitte Zahl bei Höheneinheiten eingeben";
}
if (!$.trim($('#rack-he').val())) {
error = "Höheneinheiten darf nicht leer sein";
}
if (!$.trim($('#rack-name').val())) {
error = "Schrank Name darf nicht leer sein";
}
if (!error) {
$.post(linkAddRack + "&pop_id=" + popid, {
name: $.trim($('#rack-name').val()),
he: $.trim($('#rack-he').val())
}, function (data) {
if (data.success === true) {
$('#rackModal').modal('toggle');
location.reload();
}
}, "json");
} else {
$(this).closest('.modal').find('.alert').text(error);
$(this).closest('.modal').find('.alert').show();
}
});
$("body").on("click", "#rack-remove", function () {
var rackid = $(this).data('rackid');
$.post(linkRemoveRack, {
id: rackid
}, function (data) {
if (data.success === true) {
$('#rackModal').modal('toggle');
location.reload();
}
}, "json");
});
$("body").on("change", "#module-width", function () {
if ($(this).val() == "12") {
$('#module-position-div').hide();
} else if ($(this).val() == "6") {
$('#module-position').html(`<option value="1">1</option>
<option value="2">2</option>
`);
$('#module-position-div').show();
} else if ($(this).val() == "4") {
$('#module-position').html(`<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
`);
$('#module-position-div').show();
} else if ($(this).val() == "3") {
$('#module-position').html(`<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
`);
$('#module-position-div').show();
}
});
$("body").on("change", "#module-ports", function () {
var plugs = [];
if ($(this).find(':selected').data('plugs') !== undefined) {
plugs = $(this).find(':selected').data('plugs').split(';');
$("#module-plug option").each(function () {
if (plugs.includes($(this).val())) {
$(this).show();
} else {
if ($(this).val() == $('#module-plug').val()) {
$('#module-plug').val(plugs[0]);
}
$(this).hide();
}
});
}
});
$("body").on("change", "#module-slot", function () {
$('#module-position').val($(this).val());
var parent = trigger.closest('tr');
if (trigger.closest('tr').find('td').eq(1).html() === undefined) {
parent = trigger.closest('tr').prev();
for (let i = 1; i <= rackhe; i++) {
if (parent.find('td').eq(1).html() !== undefined) {
break;
} else {
parent = parent.prev();
}
}
}
var newmodule = false;
var tdnumber = parseInt($(this).val())
if (parent.find('td').eq(tdnumber).data('id') === undefined) {
newmodule = true;
}
if (!newmodule) {
$('#module-remove').show();
$('#module-update').show();
$('#module-add').hide();
$('#module-type').val(parent.find('td').eq(tdnumber).data('type')).change();
if ($('#module-type').val() == "1") {
$('#module-device-id').hide();
$('#module-device-text').text(parent.find('td').eq(tdnumber).data('name'));
$('#module-device-text').show();
}
if (parent.find('td').eq(tdnumber).data('ports') != "") {
$('#module-ports').val(parent.find('td').eq(tdnumber).data('ports')).change();
$('#module-plug').val(parent.find('td').eq(tdnumber).data('plug'));
}
$('#module-type').attr('disabled', 'disabled');
$('#module-name').val(parent.find('td').eq(tdnumber).data('name'));
// $('#module-name').attr('disabled', 'disabled');
$('#module-remove').data('moduleid', parent.find('td').eq(tdnumber).data('id'));
$('#module-update').data('moduleid', parent.find('td').eq(tdnumber).data('id'));
} else {
$('#module-remove').hide();
$('#module-update').hide();
$('#module-add').show();
$('#module-name-div').show();
$('#module-name').removeAttr('disabled');
$('#module-device-div').hide();
$('#module-device-id').show();
$('#module-device-id').attr('disabled', 'disabled');
$('#module-type').val('0').change();
$('#module-type').removeAttr('disabled');
$('#module-plug').removeAttr('disabled');
$('#module-ports').removeAttr('disabled');
$('#module-name').val('');
$('#module-ports').val('48');
$('#module-ports').trigger("change");
$('#module-position-div').hide();
$('#module-update').hide();
$('#module-device-text').hide();
}
});
});

View File

@@ -0,0 +1,23 @@
<?php
require("../config/config.php");
define('FRONKDB_SQLDEBUG', false);
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
require_once(LIBDIR . "/mvcfronk/mfRouter/mfRouter.php");
require_once(LIBDIR . "/mvcfronk/mfBase/mfBaseModel.php");
require_once(LIBDIR . "/mvcfronk/mfBase/mfBaseController.php");
define("INTERNAL_USER_ID", 1);
$me = new User(1);
foreach (PopModel::getAll() as $pop) {
$data['network_id'] = $pop->network_id;
$data['pop_id'] = $pop->id;
$data['create_by'] = $me->id;
$data['edit_by'] = $me->id;
$popNetwork = PopNetworkModel::create($data);
$popNetwork->save();
}