示例#1
0
 public function runPrehladKreditov(Trace $trace, Request $request)
 {
     $format = $request->getParameter('format', 'html');
     $prehladKreditovDialog = $this->administraciaStudiaScreen->getPrehladKreditovDialog($trace, $this->studium);
     $predmety = $prehladKreditovDialog->getPredmety($trace);
     $prehladKreditovDialog->closeWindow();
     $this->warnings->warnWrongTableStructure($trace, 'prehlad kreditov', regression\PrehladKreditovRegression::get(), $predmety->getTableDefinition());
     $predmetyData = $hodnoteniaData = Sorter::sort($predmety->getData(), array("akRok" => 1, "semester" => -1, "nazov" => 1));
     $priemeryCalculator = new PriemeryCalculator();
     foreach ($predmetyData as &$predmetyRow) {
         $semester = $predmetyRow['semester'] == 'L' ? PriemeryCalculator::SEMESTER_LETNY : PriemeryCalculator::SEMESTER_ZIMNY;
         try {
             $predmetyRow['timestamp'] = AIS2Utils::parseAISDate($predmetyRow['datum']);
         } catch (\Exception $e) {
             $predmetyRow['timestamp'] = null;
         }
         $znamka = $predmetyRow['znamka'];
         $priemeryCalculator->add($semester, $znamka, $predmetyRow[PredmetyFields::KREDIT]);
     }
     $this->templateParams['currentTab'] = 'PrehladKreditov';
     $this->templateParams['predmety'] = $predmetyData;
     $this->templateParams['predmetyStatistika'] = $priemeryCalculator;
     return $this->renderResponse('studium/prehladKreditov', $this->templateParams, $format == 'xml' ? 'xml' : 'html');
 }
 public function getPredmety(Trace $trace)
 {
     $data = $this->executor->readTable(array(), 'prehladKreditov');
     return new DataTableImpl(PrehladKreditovRegression::get(), $data);
 }