app->l11nManager, $request, $response); $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007101001, $request, $response); $list = InvestmentMapper::getAll() ->with('createdBy') ->sort('id', 'DESC') ->execute(); $view->data['investments'] = $list; return $view; } /** * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param array $data Generic data * * @return RenderableInterface * * @since 1.0.0 * @codeCoverageIgnore */ public function viewInvestmentObjectProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-object-profile'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007101001, $request, $response); $object = InvestmentObjectMapper::get() ->with('files') ->with('notes') ->with('amountGroups') ->with('amountGroups/type') ->with('amountGroups/amounts') ->where('id', (int) $request->getData('id')) ->execute(); $view->data['object'] = $object; /** @var \Model\Setting $settings */ $settings = $this->app->appSettings->get(null, [ SettingsEnum::DEFAULT_LOCALIZATION, ]); $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); $view->data['attributeView']->data['defaultlocalization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute(); $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response); return $view; } /** * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param array $data Generic data * * @return RenderableInterface * * @since 1.0.0 * @codeCoverageIgnore */ public function viewInvestmentProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-profile'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007101001, $request, $response); $investment = InvestmentMapper::get() ->with('notes') ->with('files') ->with('supplier') ->with('supplier/account') ->with('item') ->with('createdBy') ->with('options') ->with('options/files') ->with('options/notes') ->with('options/amountGroups') ->with('options/amountGroups/type') ->with('options/amountGroups/amounts') ->with('options/attributes') ->with('options/attributes/type') ->with('options/attributes/type/l11n') ->with('options/attributes/value') ->where('id', (int) $request->getData('id')) ->where('options/attributes/type/l11n/language', $response->header->l11n->language) ->execute(); $view->data['investment'] = $investment; /** @var \Model\Setting $settings */ $settings = $this->app->appSettings->get(null, [ SettingsEnum::DEFAULT_LOCALIZATION, ]); $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); $view->data['attributeView']->data['defaultlocalization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute(); $investmentTypes = InvestmentTypeMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) ->execute(); $view->data['types'] = $investmentTypes; $units = UnitMapper::getAll() ->execute(); $view->data['units'] = $units; $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response); $view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response); return $view; } /** * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param array $data Generic data * * @return RenderableInterface * * @since 1.0.0 * @codeCoverageIgnore */ public function viewInvestmentCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-create'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007101001, $request, $response); return $view; } }