getUser()); if ($this->hasRequestParameter('workstation')) { $data[PaginatedSqlStorage::DIAGNOSTIC_WORKSTATION] = \tao_helpers_Display::sanitizeXssHtml(trim($this->getRequestParameter('workstation'))); } return $data; } /** * Get current http parameters * Unset workstation parameters to avoid cast it as type * * @return array */ protected function getParameters() { $data = parent::getParameters(); if (isset($data['workstation'])) { unset($data['workstation']); } return $data; } /** * Gets the name of the workstation being tested * If current id is found on database, associated workstation is retrieve * Else an uniqid is generated */ public function workstation() { $response = [ 'success' => false, 'workstation' => uniqid('workstation-') ]; $diagnostic = $this->getDiagnosticDataTable()->getDiagnostic($this->getId()); if (isset($diagnostic)) { $response['success'] = true; $workstation = trim($diagnostic[PaginatedSqlStorage::DIAGNOSTIC_WORKSTATION]); if ($workstation) { $response['workstation'] = $workstation; } } $this->returnJson($response); } /** * Get the model to access diagnostic storage through dataTable * * @return DiagnosticDataTable */ protected function getDiagnosticDataTable() { if (! $this->dataTable) { $diagnosticDatatable = new DiagnosticDataTable(); $diagnosticDatatable->setServiceLocator($this->getServiceManager()); $this->dataTable = $diagnosticDatatable; } return $this->dataTable; } /** * Get config parameters for compatibility check * * @return mixed * @throws \common_ext_ExtensionException */ protected function loadConfig() { $config = parent::loadConfig(); $config['controller'] = 'DiagnosticChecker'; return $config; } }