From 612a10232e0e741fc7825b76aeca7175804b98ee Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 7 Jun 2019 23:12:57 +0200 Subject: [PATCH] prepare for module/account audits --- Controller/BackendController.php | 9 +++++---- Theme/Backend/account-list.tpl.php | 13 +++++++------ Theme/Backend/module-list.tpl.php | 14 ++++++++------ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 33793fc..1bd94ee 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,9 +14,11 @@ declare(strict_types=1); namespace Modules\Auditor\Controller; +use Modules\Admin\Models\AccountMapper; use Modules\Auditor\Models\AuditMapper; use phpOMS\Contract\RenderableInterface; +use phpOMS\DataStorage\Database\RelationType; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Views\View; @@ -91,8 +93,8 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Auditor/Theme/Backend/module-list'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response)); - $list = AuditMapper::getNewest(50); - $view->setData('audits', $list); + $list = $this->app->moduleManager->getAllModules(); + $view->setData('modules', $list); return $view; } @@ -135,8 +137,7 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Auditor/Theme/Backend/account-list'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response)); - $list = AuditMapper::getNewest(50); - $view->setData('audits', $list); + $view->setData('accounts', AccountMapper::getNewest(50, null, RelationType::NONE)); return $view; } diff --git a/Theme/Backend/account-list.tpl.php b/Theme/Backend/account-list.tpl.php index d613613..df0d9e5 100644 --- a/Theme/Backend/account-list.tpl.php +++ b/Theme/Backend/account-list.tpl.php @@ -13,6 +13,7 @@ /** * @var \phpOMS\Views\View $this */ +$accounts = $this->getData('accounts'); echo $this->getData('nav')->render(); ?> @@ -25,18 +26,18 @@ echo $this->getData('nav')->render(); ?> getHtml('ID', '0', '0'); ?> getHtml('Name') ?> - getHtml('Date') ?> - + - $audit) : ++$count; - $url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?> + $account) : ++$count; + $url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $account->getId()); ?> - + printHtml($account->getId()); ?> + printHtml($account->getName1()); ?> - getHtml('Empty', '0', '0'); ?> + getHtml('Empty', '0', '0'); ?> diff --git a/Theme/Backend/module-list.tpl.php b/Theme/Backend/module-list.tpl.php index d613613..abff021 100644 --- a/Theme/Backend/module-list.tpl.php +++ b/Theme/Backend/module-list.tpl.php @@ -14,6 +14,8 @@ * @var \phpOMS\Views\View $this */ +$modules = $this->getData('modules'); + echo $this->getData('nav')->render(); ?>
@@ -25,18 +27,18 @@ echo $this->getData('nav')->render(); ?> getHtml('ID', '0', '0'); ?> getHtml('Name') ?> - getHtml('Date') ?> - + - $audit) : ++$count; - $url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $audit->getId()); ?> + $module) : ++$count; + $url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/audit/single?{?}&id=' . $module['name']['id']); ?> - + printHtml($module['name']['id']); ?> + printHtml($module['name']['external']); ?> - getHtml('Empty', '0', '0'); ?> + getHtml('Empty', '0', '0'); ?>