From da2be763d28e998011a0eb13ee86092d9e2ccee0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 30 May 2023 15:44:14 +0200 Subject: [PATCH] Continue with getter/setter cleanup --- Controller/BackendController.php | 54 ++++++++------------- Theme/Backend/costcenter-list.tpl.php | 4 +- Theme/Backend/costobject-list.tpl.php | 4 +- Theme/Backend/entries.tpl.php | 2 +- Theme/Backend/gl-create.tpl.php | 2 +- Theme/Backend/gl-list.tpl.php | 2 +- Theme/Backend/gl-profile.tpl.php | 2 +- Theme/Backend/journal-list.tpl.php | 2 +- Theme/Backend/stack-archive-list.tpl.php | 2 +- Theme/Backend/stack-create.tpl.php | 2 +- Theme/Backend/stack-entries.tpl.php | 2 +- Theme/Backend/stack-list.tpl.php | 2 +- Theme/Backend/stack-predefined-list.tpl.php | 2 +- 13 files changed, 35 insertions(+), 47 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 52fcabe..65dd439 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -48,7 +48,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/entries'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response); return $view; } @@ -69,7 +69,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/journal-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response); return $view; } @@ -90,7 +90,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/stack-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response); return $view; } @@ -111,7 +111,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/stack-predefined-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response); return $view; } @@ -132,7 +132,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/stack-create'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response); return $view; } @@ -153,7 +153,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/stack-entries'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response); return $view; } @@ -174,7 +174,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/stack-archive-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response); return $view; } @@ -195,7 +195,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/gl-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response); return $view; } @@ -216,7 +216,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/gl-create'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response); return $view; } @@ -237,7 +237,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/gl-profile'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response); return $view; } @@ -258,7 +258,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/gl-profile'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response); return $view; } @@ -279,7 +279,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/gl-profile'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response); return $view; } @@ -300,7 +300,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/gl-profile'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response); return $view; } @@ -321,20 +321,14 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/costcenter-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002602001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002602001, $request, $response); if ($request->getData('ptype') === 'p') { - $view->setData('costcenter', - CostCenterMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->limit(25)->execute() - ); + $view->data['costcenter'] = CostCenterMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->limit(25)->execute(); } elseif ($request->getData('ptype') === 'n') { - $view->setData('costcenter', - CostCenterMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->limit(25)->execute() - ); + $view->data['costcenter'] = CostCenterMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->limit(25)->execute(); } else { - $view->setData('costcenter', - CostCenterMapper::getAll()->where('id', 0, '>')->limit(25)->execute() - ); + $view->data['costcenter'] = CostCenterMapper::getAll()->where('id', 0, '>')->limit(25)->execute(); } return $view; @@ -356,20 +350,14 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Accounting/Theme/Backend/costobject-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002603001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002603001, $request, $response); if ($request->getData('ptype') === 'p') { - $view->setData('costobject', - CostObjectMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->limit(25)->execute() - ); + $view->data['costobject'] = CostObjectMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->limit(25)->execute(); } elseif ($request->getData('ptype') === 'n') { - $view->setData('costobject', - CostObjectMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->limit(25)->execute() - ); + $view->data['costobject'] = CostObjectMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->limit(25)->execute(); } else { - $view->setData('costobject', - CostObjectMapper::getAll()->where('id', 0, '>')->limit(25)->execute() - ); + $view->data['costobject'] = CostObjectMapper::getAll()->where('id', 0, '>')->limit(25)->execute(); } return $view; diff --git a/Theme/Backend/costcenter-list.tpl.php b/Theme/Backend/costcenter-list.tpl.php index d628a4c..d81b909 100755 --- a/Theme/Backend/costcenter-list.tpl.php +++ b/Theme/Backend/costcenter-list.tpl.php @@ -18,12 +18,12 @@ use phpOMS\Uri\UriFactory; * @var \phpOMS\Views\View $this * @var \Modules\Tag\Models\CostCenter[] $costcenter */ -$costcenter = $this->getData('costcenter'); +$costcenter = $this->data['costcenter']; $previous = empty($costcenter) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \reset($costcenter)->id . '&ptype=p'; $next = empty($costcenter) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \end($costcenter)->id . '&ptype=n'; -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/costobject-list.tpl.php b/Theme/Backend/costobject-list.tpl.php index c052ee5..e341d23 100755 --- a/Theme/Backend/costobject-list.tpl.php +++ b/Theme/Backend/costobject-list.tpl.php @@ -18,12 +18,12 @@ use phpOMS\Uri\UriFactory; * @var \phpOMS\Views\View $this * @var \Modules\Tag\Models\CostObject[] $costobject */ -$costobject = $this->getData('costobject'); +$costobject = $this->data['costobject']; $previous = empty($costobject) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \reset($costobject)->id . '&ptype=p'; $next = empty($costobject) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \end($costobject)->id . '&ptype=n'; -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/entries.tpl.php b/Theme/Backend/entries.tpl.php index 8046335..65b6030 100755 --- a/Theme/Backend/entries.tpl.php +++ b/Theme/Backend/entries.tpl.php @@ -12,7 +12,7 @@ */ declare(strict_types=1); -//echo $this->getData('nav')->render(); +//echo $this->data['nav']->render(); $footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response); $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); diff --git a/Theme/Backend/gl-create.tpl.php b/Theme/Backend/gl-create.tpl.php index bae8e5f..178a32a 100755 --- a/Theme/Backend/gl-create.tpl.php +++ b/Theme/Backend/gl-create.tpl.php @@ -12,7 +12,7 @@ */ declare(strict_types=1); -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>

getHtml('GL'); ?>

diff --git a/Theme/Backend/gl-list.tpl.php b/Theme/Backend/gl-list.tpl.php index 168da4c..7072ad2 100755 --- a/Theme/Backend/gl-list.tpl.php +++ b/Theme/Backend/gl-list.tpl.php @@ -23,7 +23,7 @@ $footerView->setPages(25); $footerView->setPage(1); $footerView->setResults(1); -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/gl-profile.tpl.php b/Theme/Backend/gl-profile.tpl.php index 94c11af..58dda56 100755 --- a/Theme/Backend/gl-profile.tpl.php +++ b/Theme/Backend/gl-profile.tpl.php @@ -12,4 +12,4 @@ */ declare(strict_types=1); -echo $this->getData('nav')->render(); +echo $this->data['nav']->render(); diff --git a/Theme/Backend/journal-list.tpl.php b/Theme/Backend/journal-list.tpl.php index e114e10..668a43c 100755 --- a/Theme/Backend/journal-list.tpl.php +++ b/Theme/Backend/journal-list.tpl.php @@ -23,7 +23,7 @@ $footerView->setPages(25); $footerView->setPage(1); $footerView->setResults(1); -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/stack-archive-list.tpl.php b/Theme/Backend/stack-archive-list.tpl.php index bd5e3eb..d1697b5 100755 --- a/Theme/Backend/stack-archive-list.tpl.php +++ b/Theme/Backend/stack-archive-list.tpl.php @@ -23,7 +23,7 @@ $footerView->setPages(25); $footerView->setPage(1); $footerView->setResults(1); -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/stack-create.tpl.php b/Theme/Backend/stack-create.tpl.php index 51a2d08..0b75efe 100755 --- a/Theme/Backend/stack-create.tpl.php +++ b/Theme/Backend/stack-create.tpl.php @@ -15,7 +15,7 @@ declare(strict_types=1); /** * @var \phpOMS\Views\View $this */ -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>

getHtml('Stack'); ?>

diff --git a/Theme/Backend/stack-entries.tpl.php b/Theme/Backend/stack-entries.tpl.php index 94c11af..58dda56 100755 --- a/Theme/Backend/stack-entries.tpl.php +++ b/Theme/Backend/stack-entries.tpl.php @@ -12,4 +12,4 @@ */ declare(strict_types=1); -echo $this->getData('nav')->render(); +echo $this->data['nav']->render(); diff --git a/Theme/Backend/stack-list.tpl.php b/Theme/Backend/stack-list.tpl.php index 69b1eee..9a3dcab 100755 --- a/Theme/Backend/stack-list.tpl.php +++ b/Theme/Backend/stack-list.tpl.php @@ -23,7 +23,7 @@ $footerView->setPages(25); $footerView->setPage(1); $footerView->setResults(1); -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/stack-predefined-list.tpl.php b/Theme/Backend/stack-predefined-list.tpl.php index b760526..d1b84ad 100755 --- a/Theme/Backend/stack-predefined-list.tpl.php +++ b/Theme/Backend/stack-predefined-list.tpl.php @@ -23,7 +23,7 @@ $footerView->setPages(25); $footerView->setPage(1); $footerView->setResults(1); -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>