From 7b51ab11fbf7c03e2c98a54102665c0132e75809 Mon Sep 17 00:00:00 2001 From: RomanSteinberg <roman.accs@gmail.com> Date: Sat, 10 Jan 2015 21:57:59 +0300 Subject: [PATCH] FIX: final form file name; FIX: dean office controls behavior --- .../Controller/Handler/FileCreator.php | 6 +++- .../media/js/dean_office/dean_office.js | 33 +++++++++++-------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/~dev_rating/application/classes/Controller/Handler/FileCreator.php b/~dev_rating/application/classes/Controller/Handler/FileCreator.php index b8967c537..10c703f18 100644 --- a/~dev_rating/application/classes/Controller/Handler/FileCreator.php +++ b/~dev_rating/application/classes/Controller/Handler/FileCreator.php @@ -180,6 +180,7 @@ class Controller_Handler_FileCreator extends Controller_Handler // preparation $db = $this->model; $info = $db->getFinalFormInfo($disciplineID, $groupID); + $type = $info[0]['ExamType']; $templateFile = DOCROOT."docs/template $type.xls"; @@ -192,7 +193,10 @@ class Controller_Handler_FileCreator extends Controller_Handler // $specName = ''; <------- TODO $this->printDisciplineToExcelFile($objPHPExcel, $disciplineID, $groupID, $info[0]); - $this->GetHeaders("FinalForm".$disciplineID."_".$groupID); + $grade = $info[0]["GradeNum"]; + $group = $info[0]["GroupNum"]; + //$this->GetHeaders("FinalForm".$disciplineID."_".$groupID); + $this->GetHeaders("FinalForm_".$grade."_".$group); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); } diff --git a/~dev_rating/media/js/dean_office/dean_office.js b/~dev_rating/media/js/dean_office/dean_office.js index c3b782fa9..501aa5d05 100644 --- a/~dev_rating/media/js/dean_office/dean_office.js +++ b/~dev_rating/media/js/dean_office/dean_office.js @@ -1,31 +1,33 @@ var $ = jQuery; -function controlVisualization() { - var disciplineType = $("input[name=DisciplineType]:checked").val(); - if (disciplineType === 'exam') { - $("#SelectDisciplineDiv").show(); - $("#DownloadStatement").hide(); - } else if (disciplineType === 'credit') { - $("#SelectDisciplineDiv").hide(); - $("#DownloadStatement").show(); - } -} - $(function() { + + function controlVisualization() { + var disciplineType = $("input[name=DisciplineType]:checked").val(); + if (disciplineType === 'exam') { + $("#SelectDisciplineDiv").show(); + $("#DownloadStatement").hide(); + } else if (disciplineType === 'credit') { + $("#SelectDisciplineDiv").hide(); + $("#DownloadStatement").show(); + } + } // on page loaded controlVisualization(); var jDownloadStatement = $("#DownloadStatement"); var jDownloadExamDocument = $("#DownloadExamDocument"); + var jSelectGroup = $("#SelectGroup"); + var jSelectDiscipline = $("#SelectDiscipline"); $("#ExamChoice").change(controlVisualization); $("#CreditChoice").change(controlVisualization); + //Получить список групп по ID курса $("#SelectGrade").change(function() { var gradeID = parseInt($(this).val()) || 0; - var jSelectGroup = $("#SelectGroup"); if (gradeID > 0) { $.post( g_URLdir + "handler/GetData/GetGroups", @@ -38,6 +40,7 @@ $(function() { console.log(d.data); var i = 0; jSelectGroup.html("<option>-Не выбрана-</option>"); + jSelectDiscipline.html("<option>-Не выбрана-</option>"); for (i in d.data) { group = d.data[i]; @@ -56,6 +59,7 @@ $(function() { jDownloadStatement.attr("disabled", "disabled"); } + jDownloadExamDocument.attr("disabled", 1); }); $("#SelectGroup").change(function() { @@ -64,7 +68,6 @@ $(function() { jDownloadStatement.removeAttr("disabled"); // Заполнить список дисциплин - var jSelectDiscipline = $("#SelectDiscipline"); $.post( g_URLdir + "handler/GetData/GetDisciplinesForGroup", { @@ -89,13 +92,15 @@ $(function() { ); } else jDownloadStatement.attr("disabled", "disabled"); + + jDownloadExamDocument.attr("disabled", 1); }); $("#SelectDiscipline").change(function() { var disciplineID = parseInt($(this).val()) || 0; if (disciplineID > 0) jDownloadExamDocument.removeAttr("disabled"); - else jDownloadExamDocument.attr("disabled", "disabled"); + else jDownloadExamDocument.attr("disabled", 1); }); // Скачать ведомость -- GitLab