Filestore Beta
This commit is contained in:
@@ -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" rel="stylesheet" type="text/css"/>
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
@@ -33,17 +33,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
|
||||
<?php
|
||||
if (!$me->permissions->isAdmin) {
|
||||
foreach ($networkaddresses as $networkaddress) {
|
||||
if ($me->address->id == $networkaddress->address_id) {
|
||||
$allowedNetworks[$networkaddress->network_id] = "ok";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<table id="datatable" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Ersteller</th>
|
||||
<th>Netzgebiet</th>
|
||||
<th>Bearbeiter</th>
|
||||
<th ></th>
|
||||
<th class="edit-width-large"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
@@ -54,16 +62,42 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($files as $file): ?>
|
||||
<?php foreach ($files as $file):
|
||||
|
||||
if (!$me->permissions->isAdmin) {
|
||||
if (!array_key_exists($file->networkid, $allowedNetworks)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $file->name ?></td>
|
||||
<td><?= $file->description ?></td>
|
||||
<td><?= $file->creator->name ?> (<?= date("d.m.Y , H:i", $file->create) ?>)</td>
|
||||
<td><?= $file->network ?></td>
|
||||
|
||||
<!--<td>--><?php //= $file->creator->name
|
||||
?><!-- (-->
|
||||
<?php //= date("d.m.Y , H:i", $file->create)
|
||||
?><!--)</td>-->
|
||||
<td><?= $file->editor->name ?> (<?= date("d.m.Y , H:i", $file->edit) ?>)</td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?=self::getUrl("File", "download", ["id" => $file->file_id, 's' => $pagination['start']])?>"><i class="far fa-download" title="Download"></i></a>
|
||||
<a href="<?=self::getUrl("Filestore", "edit", ["id" => $file->id, 's' => $pagination['start']])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?=self::getUrl("Filestore", "delete", ["id" => $file->id, 's' => $pagination['start']])?>" onclick="if(!confirm('Person/Firma wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
<a href="<?= self::getUrl("File", "download", ["id" => $file->file_id]) ?>"><i
|
||||
class="far fa-download" title="Download"></i></a>
|
||||
<a href="<?= self::getUrl("Filestore", "edit", ["id" => $file->id, "mode" => "add-version"]) ?>"><i
|
||||
class="far fa-file-circle-plus" title="Dateiversion hinzufügen"></i></a>
|
||||
|
||||
<i data-id="<?= $file->id ?>" title="Versionsverlauf"
|
||||
class="fa-solid fa-clock-rotate-left history-ico check-history"></i>
|
||||
<a href="<?= self::getUrl("Filestore", "edit", ["id" => $file->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
|
||||
<?php if ($me->permissions->isAdmin || $me->id == $file->edit_by) : ?>
|
||||
<a style="float: right"
|
||||
href="<?= self::getUrl("Filestore", "delete", ["id" => $file->id]) ?>"
|
||||
onclick="if(!confirm('Datei wirklich löschen?')) return false;"
|
||||
class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -72,7 +106,6 @@
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -81,13 +114,66 @@
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch=[2,3,4];
|
||||
var hidesearch = [3, 4];
|
||||
var cstmdom = "flrtip";
|
||||
$(document).ready(function () {
|
||||
$(".check-history").click(function () {
|
||||
let dataobject = $(this);
|
||||
let fsiid = $(this).data('id');
|
||||
if ($('.filestore-history-' + fsiid).length) {
|
||||
$('.filestore-history-' + fsiid).remove();
|
||||
} else {
|
||||
$.getJSON("/Filestore/api",
|
||||
{id: $(this).data('id')},
|
||||
|
||||
function (data) {
|
||||
let expandtr;
|
||||
|
||||
expandtr = `<tr class="filestore-history-tr filestore-history-` + fsiid + `">
|
||||
<td colspan="5" class="filestore-history-td" >
|
||||
<table class="float-right table table-bordered table-condensed" style="width: auto;">
|
||||
<thead>
|
||||
<tr style="background-color: #fff">
|
||||
<th>Beschreibung</th>
|
||||
<th>Bearbeiter</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
`;
|
||||
$.each(data, function (i, item) {
|
||||
let isdelete = '';
|
||||
console.log(item.edit);
|
||||
var date = new Date(item.edit * 1000);
|
||||
var day = "0" + date.getDay();
|
||||
var month = "0" + date.getMonth();
|
||||
var year = date.getFullYear();
|
||||
var hours = date.getHours();
|
||||
var minutes = "0" + date.getMinutes();
|
||||
var formattedTime = day + '.' + month + '.' + year + ', ' + hours + ':' + minutes.substr(-2);
|
||||
if (item.is_delete == "1") {
|
||||
isdelete = `<a style="float: right" href="/Filestore/delete/?id=` + item.file_id + `&s=0" onclick="if(!confirm('Datei wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>`;
|
||||
}
|
||||
|
||||
expandtr = expandtr + `<tr class="filestore-history">
|
||||
|
||||
<td>` + item.description + `</td>
|
||||
|
||||
<td>` + item.workername + ` (` + formattedTime + `)</td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;width: 140px;">
|
||||
<a href="/File/download/?id=` + item.file_id + `&s=0"><i class="far fa-download" title="Download"></i></a>
|
||||
` + isdelete + `
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
});
|
||||
expandtr = expandtr + `</table></td></tr>`;
|
||||
dataobject.closest('tr').after(expandtr);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="<?=self::getResourcePath()?>assets/js/datatables-std.js"></script>
|
||||
<script type="text/javascript" src="<?= self::getResourcePath() ?>assets/js/datatables-std.js"></script>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user