mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-01-11 13:08:40 +00:00
bug fixes and permission tests
This commit is contained in:
parent
3f19ae1126
commit
eaefdf1256
|
|
@ -51,11 +51,19 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response));
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('audits', AuditMapper::getAll()->with('createdBy')->sort('createdAt', OrderType::DESC)->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute());
|
||||
$data = AuditMapper::getAll()->with('createdBy')->sort('id', OrderType::ASC)->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute();
|
||||
|
||||
if (empty($data)) {
|
||||
$data = AuditMapper::getAll()->with('createdBy')->sort('id', OrderType::DESC)->where('id', 0, '>')->limit(25)->execute();
|
||||
} else {
|
||||
$data = \array_reverse($data);
|
||||
}
|
||||
|
||||
$view->setData('audits', $data);
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('audits', AuditMapper::getAll()->with('createdBy')->sort('createdAt', OrderType::DESC)->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute());
|
||||
$view->setData('audits', AuditMapper::getAll()->with('createdBy')->sort('id', OrderType::DESC)->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute());
|
||||
} else {
|
||||
$view->setData('audits', AuditMapper::getAll()->with('createdBy')->sort('createdAt', OrderType::DESC)->where('id', 0, '>')->limit(25)->execute());
|
||||
$view->setData('audits', AuditMapper::getAll()->with('createdBy')->sort('id', OrderType::DESC)->where('id', 0, '>')->limit(25)->execute());
|
||||
}
|
||||
|
||||
return $view;
|
||||
|
|
@ -80,7 +88,7 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response));
|
||||
|
||||
/** @var \Modules\Auditor\Models\Audit $audit */
|
||||
$audit = AuditMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$audit = AuditMapper::get()->with('createdBy')->where('id', (int) $request->getData('id'))->execute();
|
||||
$view->setData('audit', $audit);
|
||||
|
||||
return $view;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,14 @@ echo $this->getData('nav')->render(); ?>
|
|||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Audits'); ?><i class="fa fa-download floatRight download btn"></i></div>
|
||||
<div class="portlet-head">
|
||||
<span>
|
||||
<a href="<?= UriFactory::build($previous); ?>"><i class="fa fa-chevron-left btn"></i></a>
|
||||
<?= $this->getHtml('Audits'); ?>
|
||||
<a href="<?= UriFactory::build($next); ?>"><i class="fa fa-chevron-right btn"></i></a>
|
||||
</span>
|
||||
|
||||
<i class="fa fa-download floatRight download btn"></i></div>
|
||||
<div class="slider">
|
||||
<table id="auditList" class="default sticky">
|
||||
<thead>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user