/** * Invoke an action given its name * * This function requests information necessary to operate on * VSES017 AIS application * * @param Trace $trace trace object * @param string $action action name * @param Context $context fajr context */ public function invokeAction(Trace $trace, $action, Context $context) { $request = $context->getRequest(); $response = $context->getResponse(); Preconditions::checkIsString($action); $this->screenFactory = new VSES017\VSES017_factory($context->getAisConnection()); $this->adminStudia = $this->screenFactory->newAdministraciaStudiaScreen($trace); $this->studium = $request->getParameter('studium', '0'); $this->zoznamStudii = $this->adminStudia->getZoznamStudii($trace->addChild("Get Zoznam Studii:")); $this->zapisneListy = $this->adminStudia->getZapisneListy($trace->addChild('getZapisneListy'), $this->studium); $this->zapisnyList = $request->getParameter('list'); if (empty($this->zapisnyList)) { $tmp = $this->zapisneListy->getData(); $lastList = end($tmp); $this->zapisnyList = $lastList['index']; } $this->terminyHodnoteniaScreen = $this->screenFactory->newTerminyHodnoteniaScreen($trace, $this->adminStudia->getZapisnyListIdFromZapisnyListIndex($trace, $this->zapisnyList), $this->adminStudia->getStudiumIdFromZapisnyListIndex($trace, $this->zapisnyList)); // FIXME: chceme to nejak refaktorovat, aby sme nevytvarali zbytocne // objekty, ktore v konstruktore robia requesty $this->hodnoteniaScreen = $this->screenFactory->newHodnoteniaPriemeryScreen($trace, $this->adminStudia->getZapisnyListIdFromZapisnyListIndex($trace, $this->zapisnyList)); $response->set('zoznamStudii', $this->zoznamStudii); $response->set('studium', $this->studium); $response->set('zapisneListy', $this->zapisneListy); $response->set('zapisnyList', $this->zapisnyList); parent::invokeAction($trace, $action, $context); }