diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 7d492e6..fee26f6 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -49,29 +49,23 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/WarehouseManagement/Theme/Backend/stock-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response); if ($request->getData('ptype') === 'p') { - $view->setData('stocks', - StockMapper::getAll() + $view->data['stocks'] = StockMapper::getAll() ->where('id', $request->getDataInt('id') ?? 0) ->limit(25) - ->execute() - ); + ->execute(); } elseif ($request->getData('ptype') === 'n') { - $view->setData('stocks', - StockMapper::getAll() + $view->data['stocks'] = StockMapper::getAll() ->where('id', $request->getDataInt('id') ?? 0) ->limit(25) - ->execute() - ); + ->execute(); } else { - $view->setData('stocks', - StockMapper::getAll() + $view->data['stocks'] = StockMapper::getAll() ->where('id', 0) ->limit(25) - ->execute() - ); + ->execute(); } return $view; @@ -94,9 +88,9 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/WarehouseManagement/Theme/Backend/stock'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response); - $view->setData('stock', StockMapper::get()->where('id', (int) $request->getData('id'))->execute()); + $view->data['stock'] = StockMapper::get()->where('id', (int) $request->getData('id'))->execute(); return $view; } @@ -118,29 +112,23 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/WarehouseManagement/Theme/Backend/stock-location-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response); if ($request->getData('ptype') === 'p') { - $view->setData('locations', - StockLocationMapper::getAll() + $view->data['locations'] = StockLocationMapper::getAll() ->where('id', $request->getDataInt('id') ?? 0) ->limit(25) - ->execute() - ); + ->execute(); } elseif ($request->getData('ptype') === 'n') { - $view->setData('locations', - StockLocationMapper::getAll() + $view->data['locations'] = StockLocationMapper::getAll() ->where('id', $request->getDataInt('id') ?? 0) ->limit(25) - ->execute() - ); + ->execute(); } else { - $view->setData('locations', - StockLocationMapper::getAll() + $view->data['locations'] = StockLocationMapper::getAll() ->where('id', 0) ->limit(25) - ->execute() - ); + ->execute(); } return $view; @@ -163,9 +151,9 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/WarehouseManagement/Theme/Backend/stock-location'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001302001, $request, $response); - $view->setData('location', StockLocationMapper::get()->where('id', (int) $request->getData('id'))->execute()); + $view->data['location'] = StockLocationMapper::get()->where('id', (int) $request->getData('id'))->execute(); return $view; } diff --git a/Theme/Backend/stock-list.tpl.php b/Theme/Backend/stock-list.tpl.php index 997cc9e..3a3eb6f 100755 --- a/Theme/Backend/stock-list.tpl.php +++ b/Theme/Backend/stock-list.tpl.php @@ -14,9 +14,9 @@ declare(strict_types=1); use phpOMS\Uri\UriFactory; -$stocks = $this->getData('stocks') ?? []; +$stocks = $this->data['stocks'] ?? []; -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/stock-location-list.tpl.php b/Theme/Backend/stock-location-list.tpl.php index 45d3d13..d201aee 100755 --- a/Theme/Backend/stock-location-list.tpl.php +++ b/Theme/Backend/stock-location-list.tpl.php @@ -14,9 +14,9 @@ declare(strict_types=1); use phpOMS\Uri\UriFactory; -$locations = $this->getData('locations') ?? []; +$locations = $this->data['locations'] ?? []; -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/stock-location.tpl.php b/Theme/Backend/stock-location.tpl.php index 82dfc03..7edeff1 100755 --- a/Theme/Backend/stock-location.tpl.php +++ b/Theme/Backend/stock-location.tpl.php @@ -12,9 +12,9 @@ */ declare(strict_types=1); -$location = $this->getData('location'); +$location = $this->data['location']; -echo $this->getData('nav')->render(); +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/stock.tpl.php b/Theme/Backend/stock.tpl.php index fa3659b..a5cb253 100755 --- a/Theme/Backend/stock.tpl.php +++ b/Theme/Backend/stock.tpl.php @@ -12,9 +12,9 @@ */ declare(strict_types=1); -$stock = $this->getData('stock'); +$stock = $this->data['stock']; -echo $this->getData('nav')->render(); +echo $this->data['nav']->render(); ?>