app->l11nManager, $request, $response); $view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response); $mapper = ContractMapper::getAll() ->with('account') ->limit(25); if ($request->getData('ptype') === 'p') { $view->data['contracts'] = $mapper->where('id', $request->getDataInt('id') ?? 0, '<')->execute(); } elseif ($request->getData('ptype') === 'n') { $view->data['contracts'] = $mapper->where('id', $request->getDataInt('id') ?? 0, '>')->execute(); } else { $view->data['contracts'] = $mapper->where('id', 0, '>')->execute(); } return $view; } /** * Routing end-point for application behaviour. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param mixed $data Generic data * * @return RenderableInterface * * @since 1.0.0 * @codeCoverageIgnore */ public function viewContractTypeList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-type-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response); $mapper = ContractTypeMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) ->limit(25); if ($request->getData('ptype') === 'p') { $view->data['types'] = $mapper->where('id', $request->getDataInt('id') ?? 0, '<')->execute(); } elseif ($request->getData('ptype') === 'n') { $view->data['types'] = $mapper->where('id', $request->getDataInt('id') ?? 0, '>')->execute(); } else { $view->data['types'] = $mapper->where('id', 0, '>')->execute(); } return $view; } /** * Routing end-point for application behaviour. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param mixed $data Generic data * * @return RenderableInterface * * @since 1.0.0 * @codeCoverageIgnore */ public function viewContractType(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-type'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response); $type = ContractTypeMapper::get() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) ->where('id', (int) $request->getData('id')) ->execute(); $view->data['type'] = $type; return $view; } /** * Routing end-point for application behaviour. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response * @param mixed $data Generic data * * @return RenderableInterface * * @since 1.0.0 * @codeCoverageIgnore */ public function viewContract(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-single'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response); $contract = ContractMapper::get() ->with('account') ->with('files') ->where('id', (int) $request->getData('id')) ->sort('files/id', 'DESC') ->execute(); $view->data['contract'] = $contract; $contractTypes = ContractTypeMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) ->execute(); $view->data['contractTypes'] = $contractTypes; $units = UnitMapper::getAll() ->execute(); $view->data['units'] = $units; $view->data['editor'] = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response); $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response); return $view; } }