add css version

This commit is contained in:
Dennis Eichhorn 2022-08-16 19:11:58 +02:00
parent 19fe0c0d11
commit a6659d097f
5 changed files with 64 additions and 38 deletions

View File

@ -10,8 +10,8 @@
"type": "upload", "type": "upload",
"create_collection": true, "create_collection": true,
"name": "Default", "name": "Default",
"virtualPath": "/Modules/Auditor", "virtualPath": "/Modules/Auditor/Default",
"path": "/Modules/Auditor", "path": "/Modules/Auditor/Default",
"files": [ "files": [
"/Modules/Auditor/Admin/Install/Media/defaultReport.pdf.php" "/Modules/Auditor/Admin/Install/Media/defaultReport.pdf.php"
], ],

View File

@ -39,13 +39,13 @@
}, },
"auditor_audit_old": { "auditor_audit_old": {
"name": "auditor_audit_old", "name": "auditor_audit_old",
"type": "TEXT", "type": "BLOB",
"default": null, "default": null,
"null": true "null": true
}, },
"auditor_audit_new": { "auditor_audit_new": {
"name": "auditor_audit_new", "name": "auditor_audit_new",
"type": "TEXT", "type": "BLOB",
"default": null, "default": null,
"null": true "null": true
}, },

View File

@ -53,11 +53,42 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Auditor/Theme/Backend/audit-list'); $view->setTemplate('/Modules/Auditor/Theme/Backend/audit-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response)); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response));
$searchFieldData = $request->getLike('.*\-p\-.*');
$searchField = [];
foreach ($searchFieldData as $key => $data) {
if ($data === '1') {
$split = \explode('-', $key);
$member = \end($split);
$searchField[] = $member;
}
}
$filterFieldData = $request->getLike('.*\-f\-.*?\-t');
$filterField = [];
foreach ($filterFieldData as $key => $type) {
$split = \explode('-', $key);
\end($split);
$member = \prev($split);
if (!empty($request->getData('auditlist-f-' . $member . '-f1'))) {
$filterField[$member] = [
'type' => $type,
'value1' => $request->getData('auditlist-f-' . $member . '-f1'),
'logic1' => $request->getData('auditlist-f-' . $member . '-o1'),
'value2' => $request->getData('auditlist-f-' . $member . '-f2'),
'logic2' => $request->getData('auditlist-f-' . $member . '-o2'),
];
}
}
$pageLimit = 25; $pageLimit = 25;
$view->addData('pageLimit', $pageLimit); $view->addData('pageLimit', $pageLimit);
$mapper = AuditMapper::getAll()->with('createdBy'); $mapper = AuditMapper::getAll()->with('createdBy');
$list = AuditMapper::getDataList( $list = AuditMapper::find(
search: $request->getData('search'),
mapper: $mapper, mapper: $mapper,
id: (int) ($request->getData('id') ?? 0), id: (int) ($request->getData('id') ?? 0),
secondaryId: (string) ($request->getData('subid') ?? ''), secondaryId: (string) ($request->getData('subid') ?? ''),
@ -65,12 +96,10 @@ final class BackendController extends Controller
pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')), pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')),
sortBy: $request->getData('sort_by') ?? '', sortBy: $request->getData('sort_by') ?? '',
sortOrder: $request->getData('sort_order') ?? OrderType::DESC, sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
search: $request->getData('search'), searchFields: $searchField,
searchFields: $request->getDataList('search_fields') filters: $filterField
); );
$view->setData('hasPrevious', $list['hasPrevious']);
$view->setData('hasNext', $list['hasNext']);
$view->setData('audits', $list['data']); $view->setData('audits', $list['data']);
/** @var \Model\Setting[] $exportTemplates */ /** @var \Model\Setting[] $exportTemplates */
@ -103,7 +132,8 @@ final class BackendController extends Controller
$tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table'); $tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table');
$tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-table'); $tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-table');
$tableView->setSortTemplate('/Web/Backend/Themes/sort-table'); $tableView->setSortTemplate('/Web/Backend/Themes/sort-table');
$tableView->exportUri = '{/api}auditor/list/export'; $tableView->setData('hasPrevious', $list['hasPrevious']);
$tableView->setData('hasNext', $list['hasNext']);
$view->addData('tableView', $tableView); $view->addData('tableView', $tableView);

View File

@ -43,8 +43,8 @@ final class AuditMapper extends DataMapperFactory
'auditor_audit_type' => ['name' => 'auditor_audit_type', 'type' => 'int', 'internal' => 'type'], 'auditor_audit_type' => ['name' => 'auditor_audit_type', 'type' => 'int', 'internal' => 'type'],
'auditor_audit_trigger' => ['name' => 'auditor_audit_trigger', 'type' => 'string', 'internal' => 'trigger'], 'auditor_audit_trigger' => ['name' => 'auditor_audit_trigger', 'type' => 'string', 'internal' => 'trigger'],
'auditor_audit_content' => ['name' => 'auditor_audit_content', 'type' => 'string', 'internal' => 'content'], 'auditor_audit_content' => ['name' => 'auditor_audit_content', 'type' => 'string', 'internal' => 'content'],
'auditor_audit_old' => ['name' => 'auditor_audit_old', 'type' => 'string', 'internal' => 'old'], 'auditor_audit_old' => ['name' => 'auditor_audit_old', 'type' => 'compress', 'internal' => 'old'],
'auditor_audit_new' => ['name' => 'auditor_audit_new', 'type' => 'string', 'internal' => 'new'], 'auditor_audit_new' => ['name' => 'auditor_audit_new', 'type' => 'compress', 'internal' => 'new'],
]; ];
/** /**

View File

@ -20,46 +20,32 @@ use phpOMS\Uri\UriFactory;
*/ */
$audits = $this->getData('audits') ?? []; $audits = $this->getData('audits') ?? [];
$tableView = $this->getData('tableView'); $tableView = $this->getData('tableView');
$tableView->id = 'auditList'; $tableView->id = 'auditList';
$tableView->baseUri = '{/prefix}admin/audit/list';
$tableView->exportUri = '{/api}auditor/list/export';
$tableView->setObjects($audits);
$previous = $tableView->getPreviousLink( $previous = $tableView->getPreviousLink(
'{/prefix}admin/audit/list',
$this->request, $this->request,
empty($audits) || !$this->getData('hasPrevious') ? null : \reset($audits) empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
); );
$next = $tableView->getNextLink( $next = $tableView->getNextLink(
'{/prefix}admin/audit/list',
$this->request, $this->request,
empty($audits) ? null : \end($audits), empty($this->objects) ? null : \end($this->objects),
$this->getData('hasNext') ?? false $this->getData('hasNext') ?? false
); );
$search = $tableView->getSearchLink(
'{/prefix}admin/audit/list',
'iSearchBoxTable'
);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <div class="portlet">
<div class="portlet-head"> <div class="portlet-head">
<span> <?= $tableView->renderTitle(
<a rel="prefetch" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left btn"></i></a> $this->getHtml('Audits')
<?= $this->getHtml('Audits'); ?> ); ?>
<a rel="prefetch" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right btn"></i></a>
<span role="search" class="inputWrapper">
<span class="textWrapper">
<input id="iSearchBoxTable" name="search" type="text" autocomplete="off" value="<?= $this->request->getData('search') ?? ''; ?>" autofocus>
<i class="endIcon fa fa-times fa-lg fa-fw" aria-hidden="true"></i>
</span>
<a class="button" href="<?= UriFactory::build($search); ?>&search={#iSearchBoxTable}"><i class="frontIcon fa fa-search fa-fw" aria-hidden="true"></i></a>
</span>
</span>
<?= $tableView->renderExport(); ?>
</div> </div>
<div class="slider"> <div class="slider">
<table id="<?= $tableView->id; ?>" class="default sticky"> <table id="<?= $tableView->id; ?>" class="default sticky">
@ -104,7 +90,11 @@ echo $this->getData('nav')->render(); ?>
<td><?= $tableView->renderHeaderElement( <td><?= $tableView->renderHeaderElement(
'ref', 'ref',
$this->getHtml('Ref'), $this->getHtml('Ref'),
'text' 'text',
[],
true,
true,
false
); ?> ); ?>
<td><?= $tableView->renderHeaderElement( <td><?= $tableView->renderHeaderElement(
'createdAt', 'createdAt',
@ -114,7 +104,7 @@ echo $this->getData('nav')->render(); ?>
<tbody> <tbody>
<?php $count = 0; <?php $count = 0;
foreach ($audits as $key => $audit) : ++$count; foreach ($audits as $key => $audit) : ++$count;
$url = UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?> $url = UriFactory::build('{/prefix}admin/audit/single?id=' . $audit->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td><?= $audit->getId(); ?> <td><?= $audit->getId(); ?>
<td><?= $this->printHtml($audit->getModule()); ?> <td><?= $this->printHtml($audit->getModule()); ?>
@ -136,10 +126,16 @@ echo $this->getData('nav')->render(); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
<div class="portlet-foot"> <div class="portlet-foot">
<?php if ($this->getData('hasPrevious')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a> <a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left"></i></a>
<?php endif; ?>
<?php if ($this->getData('hasNext')) : ?>
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a> <a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
<?php endif; ?>
</div> </div>
<?php endif; ?>
</div> </div>
</div> </div>
</div> </div>