Skip to content
Snippets Groups Projects
Commit d77e319a authored by xamgore's avatar xamgore
Browse files

Simplified method Model_Rating::getFinalFormInfo()

parent 3d614f3e
No related merge requests found
...@@ -201,7 +201,7 @@ class Controller_Handler_FileCreator extends Controller_Handler ...@@ -201,7 +201,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
$stage = $this->post['stage']; $stage = $this->post['stage'];
// make form from template // make form from template
$info = Model_Rating::getFinalFormInfo($disciplineID, $groupID)[0]; $info = Model_Rating::getFinalFormInfo($disciplineID, $groupID);
$info['DisciplineID'] = $disciplineID; $info['DisciplineID'] = $disciplineID;
$this->printDisciplineToExcelFile($objPHPExcel, $disciplineID, $groupID, $info, $stage); $this->printDisciplineToExcelFile($objPHPExcel, $disciplineID, $groupID, $info, $stage);
...@@ -602,7 +602,7 @@ class Controller_Handler_FileCreator extends Controller_Handler ...@@ -602,7 +602,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
foreach ($listDisciplines as $discipline) { foreach ($listDisciplines as $discipline) {
$info = Model_Rating::getFinalFormInfo($discipline->ID, $groupID); $info = Model_Rating::getFinalFormInfo($discipline->ID, $groupID);
$type = $info[0]['ExamType']; $type = $info['ExamType'];
if ($type == 'exam') { if ($type == 'exam') {
continue; continue;
} }
...@@ -616,7 +616,7 @@ class Controller_Handler_FileCreator extends Controller_Handler ...@@ -616,7 +616,7 @@ class Controller_Handler_FileCreator extends Controller_Handler
//make clone from page copy and include it in workbook //make clone from page copy and include it in workbook
$C = clone $sheetTemplate; $C = clone $sheetTemplate;
try { try {
$C->setTitle($this->getSheetName($info[0])); $C->setTitle($this->getSheetName($info));
} catch (Exception $ex) { } catch (Exception $ex) {
$C->setTitle("Без_имени_".$index); $C->setTitle("Без_имени_".$index);
} }
...@@ -633,15 +633,15 @@ class Controller_Handler_FileCreator extends Controller_Handler ...@@ -633,15 +633,15 @@ class Controller_Handler_FileCreator extends Controller_Handler
else else
{ {
try { try {
$objPHPExcel->setActiveSheetIndex($index)->setTitle($this->getSheetName($info[0])); $objPHPExcel->setActiveSheetIndex($index)->setTitle($this->getSheetName($info));
} catch (Exception $ex) { } catch (Exception $ex) {
$objPHPExcel->setActiveSheetIndex($index)->setTitle("Без_имени_".$index); $objPHPExcel->setActiveSheetIndex($index)->setTitle("Без_имени_".$index);
} }
$gradeNum = $info[0]['GradeNum']; $gradeNum = $info['GradeNum'];
$groupNum = $info[0]['GroupNum']; $groupNum = $info['GroupNum'];
} }
$this->printDisciplineToExcelFile($objPHPExcel, $discipline->ID, $groupID, $info[0]); $this->printDisciplineToExcelFile($objPHPExcel, $discipline->ID, $groupID, $info);
$index++; $index++;
} }
......
...@@ -9,7 +9,7 @@ class Controller_Handler_XMLCreator extends Controller_Handler ...@@ -9,7 +9,7 @@ class Controller_Handler_XMLCreator extends Controller_Handler
$groupID = $this->post['studyGroupID']; $groupID = $this->post['studyGroupID'];
// make form from template // make form from template
$info = Model_Rating::getFinalFormInfo($disciplineID, $groupID)[0]; $info = Model_Rating::getFinalFormInfo($disciplineID, $groupID);
$info['DisciplineID'] = $disciplineID; $info['DisciplineID'] = $disciplineID;
// prepare filename // prepare filename
......
...@@ -106,7 +106,7 @@ class Model_Rating extends Model ...@@ -106,7 +106,7 @@ class Model_Rating extends Model
->parameters([ ->parameters([
':discipline' => $discipline, ':discipline' => $discipline,
':group' => $group, ':group' => $group,
])->execute(); ])->execute()[0];
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment