datatables-std.css für Standard DT erstellt
datatables-std.js für Standard DT erstellt zugewiesen an: Device,Devicetype,Devicemanufactor,Pop,Filestore Pop Detail Ansicht erstellt Filestore auf DT umgebaut Bugfixing: * Bearbeiten aus verschiedenen Ansichten werden nun richtig zurückgeleitet (Devices/Pops) * Sortierung Devicetype in Devices wurde nun per Arraysort durchgeführt
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css" rel="stylesheet" type="text/css"/>
|
||||
<style>
|
||||
.card-border {
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
</li>
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Device") ?>">Devices</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Devices Detail</li>
|
||||
<li class="breadcrumb-item active">Device Detail</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Device <?= $devices->data->name ?> <span class="ml-2">
|
||||
<a href="<?= self::getUrl("Device", "edit", ["id" => $devices->id]) ?>">
|
||||
<h4 class="page-title">Device: <span class="font-weight-normal ml-1"><?= $devices->data->name ?></span> <span class="ml-2">
|
||||
<a href="<?= self::getUrl("Device", "edit", ["id" => $devices->id, 'returnto' => "device-detail"]) ?>">
|
||||
<button class="btn btn-primary">Bearbeiten</button>
|
||||
</a>
|
||||
</span></h4>
|
||||
@@ -95,17 +95,30 @@ if (!empty($devices->price)) {
|
||||
</div>
|
||||
<div class="col-4 card-border">
|
||||
<div>
|
||||
<h4>Standort Informationen</h4>
|
||||
<h4>Pop Informationen</h4>
|
||||
</div>
|
||||
<?php
|
||||
if (!empty(trim($devices->pop->name))) {
|
||||
|
||||
|
||||
$vlans = "";
|
||||
|
||||
if (!empty(trim($devices->pop->vlan_public)))
|
||||
$vlans .= '<span class="order-date-pill active mb-0">Public: <span class="font-weight-500">' . $devices->pop->vlan_public . '</span class="font-weight-500"></span>';
|
||||
if (!empty(trim($devices->pop->vlan_nat)))
|
||||
$vlans .= '<span class="order-date-pill active mb-0">Nat: <span class="font-weight-500">' . $devices->pop->vlan_nat . '</span></span>';
|
||||
if (!empty(trim($devices->pop->vlan_ipv6)))
|
||||
$vlans .= '<span class="order-date-pill active mb-0">IPv6: <span class="font-weight-500">' . $devices->pop->vlan_ipv6 . '</span></span>';
|
||||
|
||||
?>
|
||||
<div>
|
||||
<table class="table table-sm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Pop Name</th>
|
||||
<td><?= $devices->pop->name ?> </td>
|
||||
<td>
|
||||
<a href="<?= self::getUrl("Pop", "Detail", ["id" => $devices->pop->id]) ?>"><?= $devices->pop->name ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Adresse</th>
|
||||
@@ -116,7 +129,14 @@ if (!empty($devices->price)) {
|
||||
target="_blank"><?= rtrim($devices->pop->gps_lat, '0') ?>
|
||||
, <?= rtrim($devices->pop->gps_long, 0) ?></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Standort Info</th>
|
||||
<td><?= nl2br($devices->pop->location) ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Access VLANs</th>
|
||||
<td><?= $vlans ?> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<?php
|
||||
foreach ($devicetypes as $devicetype) {
|
||||
$deviceTypes[$devicetype->id]=$devicetype->devicemanufactor->name . " " . $devicetype->name;
|
||||
}
|
||||
asort($deviceTypes);
|
||||
|
||||
|
||||
?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -14,7 +22,7 @@
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Geräte</h4>
|
||||
<h4 class="page-title">Devices</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,7 +36,7 @@
|
||||
<h4 class="header-title mb-2"><?= ($device->id) ? "Device bearbeiten" : "Neues Gerät" ?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post"
|
||||
action="<?= self::getUrl("Device", "save") ?>">
|
||||
action="<?= self::getUrl("Device", "save", ["returnto" => $_GET["returnto"]]) ?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
@@ -46,9 +54,9 @@
|
||||
<label class="col-lg-2 col-form-label" for="devicetype_id">Gerätetyp *</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="devicetype_id" id="devicetype_id">
|
||||
<option></option>
|
||||
<?php foreach ($devicetypes as $devicetype): ?>
|
||||
<option value="<?= $devicetype->id ?>" <?= ($device->devicetype_id == $devicetype->id) ? "selected='selected'" : "" ?>><?= ($devicetype->devicemanufactor->name . " " . $devicetype->name) ?></option>
|
||||
<option> </option>
|
||||
<?php foreach ($deviceTypes as $key => $devicetype): ?>
|
||||
<option value="<?= $key ?>" <?= ($device->devicetype_id == $key) ? "selected='selected'" : "" ?>><?= ($devicetype) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -57,7 +65,7 @@
|
||||
<label class="col-lg-2 col-form-label" for="pop_id">Pop</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="pop_id" id="pop_id">
|
||||
<option></option>
|
||||
<option value="0"> </option>
|
||||
<?php foreach ($pops as $pop): ?>
|
||||
<option value="<?= $pop->id ?>" <?= ($device->pop_id == $pop->id) ? "selected='selected'" : "" ?>><?= ($pop->devicemanufactor->name . " " . $pop->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
@@ -117,7 +125,7 @@
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});
|
||||
$("#addresstypes").select2();
|
||||
$(".select2").select2();
|
||||
|
||||
// disable mousewheel on a input number field when in focus
|
||||
$('form').on('focus', 'input[type=number]', function (e) {
|
||||
|
||||
@@ -4,37 +4,9 @@ $pagination_baseurl_params = ["filter" => $filter];
|
||||
$pagination_entity_name = "Device";
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
|
||||
<link href="<?=self::getResourcePath()?>assets/css/datatables-std.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
#filterrow input {
|
||||
width: 100%;
|
||||
padding: 3px;
|
||||
box-sizing: border-box;
|
||||
display: table-header-group;
|
||||
height: unset;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_length {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.clear-fa {
|
||||
margin-left: 5px;
|
||||
font-size: 23px;
|
||||
vertical-align: middle;
|
||||
color: #cb2929;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.margina {
|
||||
margin-left: 30px !important;
|
||||
margin-top: -5px;
|
||||
}
|
||||
</style>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
@@ -74,7 +46,7 @@ $pagination_entity_name = "Device";
|
||||
<table id="datatable" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Geräte Name</th>
|
||||
<th>Device Name</th>
|
||||
<th class="text-center">Geräte Typ</th>
|
||||
<th class="text-center">Hersteller</th>
|
||||
<th class="text-center">Pop</th>
|
||||
@@ -83,7 +55,7 @@ $pagination_entity_name = "Device";
|
||||
<th class="text-center">Seriennummer</th>
|
||||
<th class="text-center">Preis</th>
|
||||
<th class="text-center">max. Leistung</th>
|
||||
<th class="w15"></th>
|
||||
<th class="edit-width"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
@@ -111,7 +83,7 @@ $pagination_entity_name = "Device";
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?= self::getUrl("Device", "detail", ["id" => $device->id]) ?>"><?= $device->name ?></a>
|
||||
<a 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>
|
||||
@@ -152,69 +124,13 @@ $pagination_entity_name = "Device";
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
let table;
|
||||
$('#filterrow th').each(function (i) {
|
||||
let title = $('#datatable thead th').eq($(this).index()).text();
|
||||
var hidesearch=[9];
|
||||
|
||||
if ($(this).index() == "9") {
|
||||
|
||||
} else {
|
||||
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
|
||||
}
|
||||
});
|
||||
|
||||
table = $('#datatable').DataTable({
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'XLSX Export',
|
||||
className: 'btn-success margina'
|
||||
|
||||
}
|
||||
],
|
||||
orderCellsTop: true,
|
||||
stateSave: true,
|
||||
"initComplete": function () {
|
||||
$('#datatable_filter').append('<i id="clear_cookie" class="fas fa-times clear-fa" title="Filter löschen" aria-hidden="true" ></i>');
|
||||
$('#clear_cookie').click(function () {
|
||||
$('input').val('');
|
||||
|
||||
table.search('').columns().search('').draw();
|
||||
});
|
||||
},
|
||||
"dom": 'flBrtip'
|
||||
|
||||
});
|
||||
|
||||
$('#filterrow').on('keyup', 'input', function () {
|
||||
|
||||
table
|
||||
.column($(this).data('index'))
|
||||
.search(this.value)
|
||||
.draw();
|
||||
|
||||
|
||||
});
|
||||
var state = table.state.loaded();
|
||||
if (state) {
|
||||
table.columns().eq(0).each(function (colIdx) {
|
||||
var colSearch = state.columns[colIdx].search;
|
||||
|
||||
if (colSearch.search) {
|
||||
|
||||
|
||||
$('#filterrow').find("[data-index='" + colIdx + "']").val(colSearch.search);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
table.draw();
|
||||
}
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>assets/js/datatables-std.js"></script>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
Reference in New Issue
Block a user