mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-01-11 13:08:40 +00:00
add css version
This commit is contained in:
parent
19fe0c0d11
commit
a6659d097f
|
|
@ -10,8 +10,8 @@
|
|||
"type": "upload",
|
||||
"create_collection": true,
|
||||
"name": "Default",
|
||||
"virtualPath": "/Modules/Auditor",
|
||||
"path": "/Modules/Auditor",
|
||||
"virtualPath": "/Modules/Auditor/Default",
|
||||
"path": "/Modules/Auditor/Default",
|
||||
"files": [
|
||||
"/Modules/Auditor/Admin/Install/Media/defaultReport.pdf.php"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@
|
|||
},
|
||||
"auditor_audit_old": {
|
||||
"name": "auditor_audit_old",
|
||||
"type": "TEXT",
|
||||
"type": "BLOB",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
"auditor_audit_new": {
|
||||
"name": "auditor_audit_new",
|
||||
"type": "TEXT",
|
||||
"type": "BLOB",
|
||||
"default": null,
|
||||
"null": true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -53,11 +53,42 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Auditor/Theme/Backend/audit-list');
|
||||
$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;
|
||||
$view->addData('pageLimit', $pageLimit);
|
||||
|
||||
$mapper = AuditMapper::getAll()->with('createdBy');
|
||||
$list = AuditMapper::getDataList(
|
||||
$list = AuditMapper::find(
|
||||
search: $request->getData('search'),
|
||||
mapper: $mapper,
|
||||
id: (int) ($request->getData('id') ?? 0),
|
||||
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')),
|
||||
sortBy: $request->getData('sort_by') ?? '',
|
||||
sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
|
||||
search: $request->getData('search'),
|
||||
searchFields: $request->getDataList('search_fields')
|
||||
searchFields: $searchField,
|
||||
filters: $filterField
|
||||
);
|
||||
|
||||
$view->setData('hasPrevious', $list['hasPrevious']);
|
||||
$view->setData('hasNext', $list['hasNext']);
|
||||
$view->setData('audits', $list['data']);
|
||||
|
||||
/** @var \Model\Setting[] $exportTemplates */
|
||||
|
|
@ -103,7 +132,8 @@ final class BackendController extends Controller
|
|||
$tableView->setColumnHeaderElementTemplate('/Web/Backend/Themes/header-element-table');
|
||||
$tableView->setFilterTemplate('/Web/Backend/Themes/popup-filter-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);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ final class AuditMapper extends DataMapperFactory
|
|||
'auditor_audit_type' => ['name' => 'auditor_audit_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'auditor_audit_trigger' => ['name' => 'auditor_audit_trigger', 'type' => 'string', 'internal' => 'trigger'],
|
||||
'auditor_audit_content' => ['name' => 'auditor_audit_content', 'type' => 'string', 'internal' => 'content'],
|
||||
'auditor_audit_old' => ['name' => 'auditor_audit_old', 'type' => 'string', 'internal' => 'old'],
|
||||
'auditor_audit_new' => ['name' => 'auditor_audit_new', 'type' => 'string', 'internal' => 'new'],
|
||||
'auditor_audit_old' => ['name' => 'auditor_audit_old', 'type' => 'compress', 'internal' => 'old'],
|
||||
'auditor_audit_new' => ['name' => 'auditor_audit_new', 'type' => 'compress', 'internal' => 'new'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,46 +20,32 @@ use phpOMS\Uri\UriFactory;
|
|||
*/
|
||||
$audits = $this->getData('audits') ?? [];
|
||||
|
||||
$tableView = $this->getData('tableView');
|
||||
$tableView->id = 'auditList';
|
||||
$tableView = $this->getData('tableView');
|
||||
$tableView->id = 'auditList';
|
||||
$tableView->baseUri = '{/prefix}admin/audit/list';
|
||||
$tableView->exportUri = '{/api}auditor/list/export';
|
||||
$tableView->setObjects($audits);
|
||||
|
||||
$previous = $tableView->getPreviousLink(
|
||||
'{/prefix}admin/audit/list',
|
||||
$this->request,
|
||||
empty($audits) || !$this->getData('hasPrevious') ? null : \reset($audits)
|
||||
empty($this->objects) || !$this->getData('hasPrevious') ? null : \reset($this->objects)
|
||||
);
|
||||
|
||||
$next = $tableView->getNextLink(
|
||||
'{/prefix}admin/audit/list',
|
||||
$this->request,
|
||||
empty($audits) ? null : \end($audits),
|
||||
empty($this->objects) ? null : \end($this->objects),
|
||||
$this->getData('hasNext') ?? false
|
||||
);
|
||||
|
||||
$search = $tableView->getSearchLink(
|
||||
'{/prefix}admin/audit/list',
|
||||
'iSearchBoxTable'
|
||||
);
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head">
|
||||
<span>
|
||||
<a rel="prefetch" href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left btn"></i></a>
|
||||
<?= $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(); ?>
|
||||
<?= $tableView->renderTitle(
|
||||
$this->getHtml('Audits')
|
||||
); ?>
|
||||
</div>
|
||||
<div class="slider">
|
||||
<table id="<?= $tableView->id; ?>" class="default sticky">
|
||||
|
|
@ -104,7 +90,11 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><?= $tableView->renderHeaderElement(
|
||||
'ref',
|
||||
$this->getHtml('Ref'),
|
||||
'text'
|
||||
'text',
|
||||
[],
|
||||
true,
|
||||
true,
|
||||
false
|
||||
); ?>
|
||||
<td><?= $tableView->renderHeaderElement(
|
||||
'createdAt',
|
||||
|
|
@ -114,7 +104,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tbody>
|
||||
<?php $count = 0;
|
||||
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; ?>">
|
||||
<td><?= $audit->getId(); ?>
|
||||
<td><?= $this->printHtml($audit->getModule()); ?>
|
||||
|
|
@ -136,10 +126,16 @@ echo $this->getData('nav')->render(); ?>
|
|||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($this->getData('hasPrevious') || $this->getData('hasNext')) : ?>
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData('hasNext')) : ?>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right"></i></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user