From 45778812f7f66ccd596d9b6e1bcb521db4064a7c Mon Sep 17 00:00:00 2001
From: PavelBegunkov <asml.Silence@gmail.com>
Date: Thu, 18 Sep 2014 17:51:33 +0400
Subject: [PATCH] megaFix

---
 .../application/classes/Controller/Teacher/Discipline.php  | 7 ++++---
 .../application/classes/Controller/Teacher/Index.php       | 7 +++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/~dev_rating/application/classes/Controller/Teacher/Discipline.php b/~dev_rating/application/classes/Controller/Teacher/Discipline.php
index dab0092f9..5c9985abb 100644
--- a/~dev_rating/application/classes/Controller/Teacher/Discipline.php
+++ b/~dev_rating/application/classes/Controller/Teacher/Discipline.php
@@ -70,6 +70,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi {
 		
 		$twig->User = $this->UserInfo;
 		$twig->Discipline = $this->GetDisciplineInfo($db, $id);
+
 		$twig->GroupsForDiscipline = $this->GetGroupsForDiscipline($db, $id);
 		$twig->StudyGroups = $this->GetStudyGroupsOrdByGroups($db, $twig->Discipline['GradeID'], $twig->Discipline['FacultyID']);
 		
@@ -184,7 +185,7 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi {
         
         $subject['LectureHours'] = $info['LectionCount'];
         $subject['PracticeHours'] = $info['PracticeCount'];
-		$subject['GradeID'] = $info['DisciplineGrade'];
+		$subject['GradeID'] = $info['GradeID'];
 		
         $teachersHandled = array(); $i = 0;
         
@@ -267,8 +268,8 @@ class Controller_Teacher_Discipline extends Controller_UserEnvi {
         return $studentsHandled;
 	}
 	
-	private function GetStudyGroupsOrdByGroups($db, $Grade, $FacultyID) {
-		$Groups = $db->GetStudyGroupsOrdByGroups($Grade, $FacultyID);
+	private function GetStudyGroupsOrdByGroups($db, $GradeID, $FacultyID) {
+		$Groups = $db->GetStudyGroupsOrdByGroups($GradeID, $FacultyID);
 		$GroupsHandled = array();
 		$i = 0;
 		
diff --git a/~dev_rating/application/classes/Controller/Teacher/Index.php b/~dev_rating/application/classes/Controller/Teacher/Index.php
index 552f784dd..f4eb811ab 100644
--- a/~dev_rating/application/classes/Controller/Teacher/Index.php
+++ b/~dev_rating/application/classes/Controller/Teacher/Index.php
@@ -12,12 +12,12 @@ class Controller_Teacher_Index extends Controller_UserEnvi {
         $groupsInDiscipline = array();
         $degrees = array('bachelor' => 'Бакалавриат', 'specialist' => 'Специалитет', 'master' => 'Магистратура');
         foreach ($disciplines as $row) {
-            if($subjID != $row['SubjectID'] || $gradeNum != $row['StudyGroupGrade'])
+            if($subjID != $row['SubjectID'] || $gradeNum != $row['GradeID'])
             {
                 $i++; $j = $k = 0;
                 $groupsInDiscipline = array();
                 $subjID = $row['SubjectID'];
-                $gradeNum = $row['StudyGroupGrade'];
+                $gradeNum = $row['GradeID'];
                 $disciplinesHandled[$i]['Title'] = $row['SubjectName'];
                 $disciplinesHandled[$i]['GradeNum'] = $row['DisciplineGrade'];                
                 $disciplinesHandled[$i]['Degree'] = $degrees[$row['DisciplineDegree']];                
@@ -40,6 +40,9 @@ class Controller_Teacher_Index extends Controller_UserEnvi {
         }
         $twig->Subjects = $disciplinesHandled;
         $twig->User = $this->UserInfo;
+
+        echo Debug::vars( $disciplinesHandled);
+
         $this->response->body($twig);
     }
     
-- 
GitLab