diff --git a/.gitignore b/.gitignore index e0efbc438c6a305480a9dd674fb76f88536ee02f..dc422697c500b03ed345a30b0fbd6cf323b19481 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +~dev_rating/application/cache/ +~dev_rating/application/logs/ +~dev_rating/application/config/ +~dev_rating/system/ +~dev_rating/modules/kotwig/cache/ nbproject/ *.*~ diff --git a/~dev_rating/application/bootstrap.php b/~dev_rating/application/bootstrap.php index 89b5f406a9fa2fc7ca45447dd40b4817af16e82f..a54333d080bcdaa6431d69ea71a09951107fe940 100644 --- a/~dev_rating/application/bootstrap.php +++ b/~dev_rating/application/bootstrap.php @@ -242,11 +242,32 @@ Route::set('teacher:map:create', 'map/create') 'action' => 'create' )); -Route::set('teacher:map:edit', 'map/<id>', array('id' => '[0-9]+')) +Route::set('teacher:map:discipline', 'map/discipline/<id>', array('id' => '[0-9]+')) ->defaults(array( 'directory' => 'teacher', 'controller' => 'map', - 'action' => 'edit' + 'action' => 'EditDiscipline' + )); + +Route::set('teacher:map:structure', 'map/structure/<id>', array('id' => '[0-9]+')) + ->defaults(array( + 'directory' => 'teacher', + 'controller' => 'map', + 'action' => 'EditStructure' + )); + +Route::set('teacher:map:groups', 'map/groups/<id>', array('id' => '[0-9]+')) + ->defaults(array( + 'directory' => 'teacher', + 'controller' => 'map', + 'action' => 'EditGroups' + )); + +Route::set('teacher:map:students', 'map/students/<id>', array('id' => '[0-9]+')) + ->defaults(array( + 'directory' => 'teacher', + 'controller' => 'map', + 'action' => 'EditStudents' )); Route::set('teacher:rating', 'rating/<id>', array('id' => '[0-9]+')) diff --git a/~dev_rating/application/cache/deleteThis.php b/~dev_rating/application/cache/deleteThis.php deleted file mode 100644 index 3ac00faa65fb817ea29da4755b6c823685234399..0000000000000000000000000000000000000000 --- a/~dev_rating/application/cache/deleteThis.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - diff --git a/~dev_rating/application/cache/twig/deleteThis.php b/~dev_rating/application/cache/twig/deleteThis.php deleted file mode 100644 index 3ac00faa65fb817ea29da4755b6c823685234399..0000000000000000000000000000000000000000 --- a/~dev_rating/application/cache/twig/deleteThis.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - diff --git a/~dev_rating/application/classes/Controller/Handler/Map.php b/~dev_rating/application/classes/Controller/Handler/Map.php index 7e9739c175e1a9b8ec333062ccb2c2d5f84836ff..e797b65689234dae443a549638972cc73f8af3fd 100644 --- a/~dev_rating/application/classes/Controller/Handler/Map.php +++ b/~dev_rating/application/classes/Controller/Handler/Map.php @@ -302,15 +302,95 @@ class Controller_Handler_Map extends Controller_Handler { $this->response->body(json_encode($data)); } - public function action_ChangeSubmoduleDescription() { - $this->post -> rule('SubmoduleID', 'not_empty') - -> rule('SubmoduleID', 'digit') - -> rule('Description', 'not_empty'); + // ------ Прикрипление студентов/РіСЂСѓРїРї/преподавателей -- + + // Прикрепить РіСЂСѓРїРїСѓ + public function action_BindGroup() { + $data['success'] = false; + $this->post -> rule('DisciplineID', 'not_empty') + -> rule('DisciplineID', 'digit') + -> rule('StudyGroupID', 'not_empty') + -> rule('StudyGroupID', 'digit'); + if($this->post->check()) { + $result = $this->model->BindGroup($this->user['TeacherID'], $this->post->offsetGet('DisciplineID'), $this->post->offsetGet('StudyGroupID')); + if ($result[0]['Num'] == 0) + $data['success'] = true; + } + $this->response->body(json_encode($data)); + } + + // Отсоединить РіСЂСѓРїРїСѓ + public function action_UnbindGroup() { + $data['success'] = false; + $this->post -> rule('DisciplineID', 'not_empty') + -> rule('DisciplineID', 'digit') + -> rule('StudyGroupID', 'not_empty') + -> rule('StudyGroupID', 'digit'); + if($this->post->check()) { + $result = $this->model->UnbindGroup($this->user['TeacherID'], $this->post->offsetGet('DisciplineID'), $this->post->offsetGet('StudyGroupID')); + if ($result[0]['Num'] == 0) + $data['success'] = true; + } + $this->response->body(json_encode($data)); + } + + // Прикрепить студента + public function action_BindStudent() { + $data['success'] = false; + $this->post -> rule('StudentID', 'not_empty') + -> rule('StudentID', 'digit') + -> rule('DisciplineID', 'not_empty') + -> rule('DisciplineID', 'digit'); + if($this->post->check()) { + $result = $this->model->BindStudent($this->user['TeacherID'], $this->post->offsetGet('DisciplineID'), $this->post->offsetGet('StudentID')); + if ($result[0]['Num'] == 0) + $data['success'] = true; + } + $this->response->body(json_encode($data)); + } + + // Отсоединить студента + public function action_UnbindStudent() { + $data['success'] = false; + $this->post -> rule('StudentID', 'not_empty') + -> rule('StudentID', 'digit') + -> rule('DisciplineID', 'not_empty') + -> rule('DisciplineID', 'digit'); + if($this->post->check()) { + $result = $this->model->UnbindStudent($this->user['TeacherID'], $this->post->offsetGet('DisciplineID'), $this->post->offsetGet('StudentID')); + if ($result[0]['Num'] == 0) + $data['success'] = true; + } + $this->response->body(json_encode($data)); + } + + // Прикрепить преподавателя + public function action_BindTeacher() { + $data['success'] = false; + $this->post -> rule('BindingTeacher', 'not_empty') + -> rule('BindingTeacher', 'digit') + -> rule('DisciplineID', 'not_empty') + -> rule('DisciplineID', 'digit'); + if($this->post->check()) { + $result = $this->model->BindTeacher($this->user['TeacherID'], $this->post->offsetGet('BindingTeacher'), $this->post->offsetGet('DisciplineID')); + if ($result[0]['Num'] == 0) + $data['success'] = true; + } + $this->response->body(json_encode($data)); + } + + // Отсоединить преподавателя + public function action_UnbindTeacher() { + $data['success'] = false; + $this->post -> rule('BindingTeacher', 'not_empty') + -> rule('BindingTeacher', 'digit') + -> rule('DisciplineID', 'not_empty') + -> rule('DisciplineID', 'digit'); if($this->post->check()) { - //$this->model->ChangeSubmoduleDescription($this->user['TeacherID'], $this->post->offsetGet('SubmoduleID'), $this->post->offsetGet('Description')); - $this->response->body(json_encode('Ok, ChangeSubmoduleDescription!')); + $result = $this->model->UnbindTeacher($this->user['TeacherID'], $this->post->offsetGet('BindingTeacher'), $this->post->offsetGet('DisciplineID')); + if ($result[0]['Num'] == 0) + $data['success'] = true; } - else - $this->response->body(json_encode('Error, ChangeSubmoduleDescription')); + $this->response->body(json_encode($data)); } } diff --git a/~dev_rating/application/classes/Controller/Handler/Rating.php b/~dev_rating/application/classes/Controller/Handler/Rating.php index 8611b15c7a92fe734f0ef317e9cf213c9d1b2b68..e3db2673ecf63a80b514469ea9e19904eb6ed572 100644 --- a/~dev_rating/application/classes/Controller/Handler/Rating.php +++ b/~dev_rating/application/classes/Controller/Handler/Rating.php @@ -10,6 +10,7 @@ class Controller_Handler_Rating extends Controller_Handler { public function action_setRate() { + $data['success'] = false; $this->post -> rule('student', 'not_empty') -> rule('student', 'digit') -> rule('submodule', 'not_empty') @@ -17,15 +18,17 @@ class Controller_Handler_Rating extends Controller_Handler { -> rule('rate', 'digit') -> rule('rate', 'range', array(':value', 0, 100)); if($this->post->check()) { - $this->model->setRate($this->user['TeacherID'], $this->post->offsetGet('student'), $this->post->offsetGet('submodule'), $this->post->offsetGet('rate')); - $this->response->body(json_encode('Ok, setRate!')); + $result = $this->model->setRate($this->user['TeacherID'], $this->post->offsetGet('student'), $this->post->offsetGet('submodule'), $this->post->offsetGet('rate')); + var_dump($this->post); + if ($result[0]['Num'] == 0) + $data['success'] = true; } - else - $this->response->body(json_encode('Error, setRate')); + $this->response->body(json_encode($data)); } public function action_changeRate() { + $data['success'] = false; $this->post -> rule('student', 'not_empty') -> rule('student', 'digit') -> rule('submodule', 'not_empty') @@ -33,11 +36,11 @@ class Controller_Handler_Rating extends Controller_Handler { -> rule('rate', 'digit') -> rule('rate', 'range', array(':value', 0, 100)); if($this->post->check()) { - $this->model->changeRate($this->user['TeacherID'], $this->post->offsetGet('student'), $this->post->offsetGet('submodule'), $this->post->offsetGet('rate')); - $this->response->body(json_encode('Ok, changeRate!')); + $result = $this->model->changeRate($this->user['TeacherID'], $this->post->offsetGet('student'), $this->post->offsetGet('submodule'), $this->post->offsetGet('rate')); + if ($result[0]['Num'] == 0) + $data['success'] = true; } - else - $this->response->body(json_encode('Error, changeRate')); + $this->response->body(json_encode($data)); } } \ No newline at end of file diff --git a/~dev_rating/application/classes/Controller/Teacher/Map.php b/~dev_rating/application/classes/Controller/Teacher/Map.php index 430f2fcd7ca90eb9514c89bc024f46cfb0c6c75e..d1321ecadedfbef85ff7dcf5b41310d488514ce5 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Map.php +++ b/~dev_rating/application/classes/Controller/Teacher/Map.php @@ -2,6 +2,8 @@ class Controller_Teacher_Map extends Controller_UserEnvi { + private $GradeID; + private $GradesList = array( 1 => array( 'ID' => '1', @@ -58,21 +60,60 @@ class Controller_Teacher_Map extends Controller_UserEnvi { $twig->GradesList = $this->GradesList; $this->response->body($twig); } - - public function action_edit() + + public function action_EditDiscipline() { $id = $this->request->param('id'); $db = new Model_Teacher_Map; - $map = $db->getMapForDiscipline($this->UserInfo['TeacherID'], $id); - - $twig = Twig::factory('teacher/map/edit'); - $twig->User = $this->UserInfo; - $twig->Map = $this->getMapInfo($map); + $twig = Twig::factory('teacher/map/EditDiscipline'); + + $twig->User = $this->UserInfo; $twig->Discipline = $this->getSubjectInfo($db, $id); $twig->SubjectsList = $this->GetSubjectsList($db); $twig->GradesList = $this->GradesList; - $this->response->body($twig); - } + + $this->response->body($twig); + } + + public function action_EditStructure() + { + $id = $this->request->param('id'); + $db = new Model_Teacher_Map; + $twig = Twig::factory('teacher/map/EditStructure'); + + $twig->User = $this->UserInfo; + $twig->Discipline = $this->getSubjectInfo($db, $id); + $twig->Map = $this->getMapInfo($db->getMapForDiscipline($this->UserInfo['TeacherID'], $id)); + + $this->response->body($twig); + } + + public function action_EditGroups() + { + $id = $this->request->param('id'); + $db = new Model_Teacher_Map; + $twig = Twig::factory('teacher/map/EditGroups'); + + $twig->User = $this->UserInfo; + $twig->Discipline = $this->getSubjectInfo($db, $id); + $twig->GroupsForDiscipline = $this->GetGroupsForDiscipline($db, $id); + $twig->StudyGroups = $this->GetStudyGroups($db, $this->GradeID, $this->UserInfo['FacultyID']); + + $this->response->body($twig); + } + + public function action_EditStudents() + { + $id = $this->request->param('id'); + $db = new Model_Teacher_Map; + $twig = Twig::factory('teacher/map/EditStudents'); + + $twig->User = $this->UserInfo; + $twig->Discipline = $this->getSubjectInfo($db, $id); + $twig->Students = $this->GetStudentsList($db, $id); + + $this->response->body($twig); + } private function getMapInfo($map) { $mapHandled = array(); @@ -122,24 +163,19 @@ class Controller_Teacher_Map extends Controller_UserEnvi { else $info = $info->offsetGet(0); + $subject['DisciplineID'] = $id; + $teachers = $db->getTeachersForDiscipline($id); $subject['SubjectName'] = $info['SubjectName']; $subject['SubjectID'] = $info['SubjectID']; - //if($info['ExamType'] == 'exam') - //{ - // $subject['Control'] = 'Ркзамен'; - //} - //elseif($info['ExamType'] == 'credit') - //{ - // $subject['Control'] = 'Зачет'; - //} $subject['ExamType'] = $info['ExamType']; $subject['LectureHours'] = $info['LectionCount']; $subject['PracticeHours'] = $info['PracticeCount']; $subject['GradeID'] = $info['DisciplineGrade']; - + $this->GradeID = $subject['GradeID']; + $teachersHandled = array(); $i = 0; foreach ($teachers as $row) { @@ -170,5 +206,60 @@ class Controller_Teacher_Map extends Controller_UserEnvi { return $SubjectsList; } + + private function GetStudentsList($db, $DisciplineID) + { + $students = $db->GetStudentsForDiscipline($this->UserInfo['TeacherID'], $DisciplineID); + $studentsHandled = array(); + $i = 0; + + foreach($students as $row) { + $i++; + $studentsHandled[$i]['StudentID'] = $row['StudentID']; + $studentsHandled[$i]['LastName'] = $row['LastName']; + $studentsHandled[$i]['FirstName'] = $row['FirstName']; + $studentsHandled[$i]['SecondName'] = $row['SecondName']; + $studentsHandled[$i]['Grade'] = $row['Grade']; + $studentsHandled[$i]['GroupNum'] = $row['GroupNum']; + $studentsHandled[$i]['Type'] = $row['Type']; + } + return $studentsHandled; + } + + private function GetStudyGroups($db, $Grade, $FacultyID) { + $Groups = $db->GetStudyGroups($Grade, $FacultyID); + $GroupsHandled = array(); + $i = 0; + + foreach($Groups as $row) { + $i++; + $GroupsHandled[$i]['GroupID'] = $row['GroupID']; + $GroupsHandled[$i]['GroupNum'] = $row['GroupNum']; + $GroupsHandled[$i]['SpecID'] = $row['SpecID']; + $GroupsHandled[$i]['SpecName'] = $row['SpecName']; + $GroupsHandled[$i]['SpecAbbr'] = $row['SpecAbbr']; + } + + return $GroupsHandled; + } + + private function GetGroupsForDiscipline($db, $DisciplineID) { + $Groups = $db->GetGroupsForDiscipline($DisciplineID); + + $GroupsHandled = array(); + $i = 0; + + foreach($Groups as $row) { + $i++; + $GroupsHandled[$i]['GroupID'] = $row['GroupID']; + $GroupsHandled[$i]['DiscGroupID'] = $row['DiscGroupID']; + $GroupsHandled[$i]['GroupGrade'] = $row['GroupGrade']; + $GroupsHandled[$i]['GroupNum'] = $row['GroupNum']; + $GroupsHandled[$i]['SpecName'] = $row['SpecName']; + $GroupsHandled[$i]['SpecAbbr'] = $row['SpecAbbr']; + } + + return $GroupsHandled; + } } \ No newline at end of file diff --git a/~dev_rating/application/classes/Controller/Teacher/Rating.php b/~dev_rating/application/classes/Controller/Teacher/Rating.php index a30d7ea2a38e8e5e023a2e81844c6d8685f40723..f8522373e864c3aec505913fe2fdc0a4df320a7c 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Rating.php +++ b/~dev_rating/application/classes/Controller/Teacher/Rating.php @@ -47,52 +47,28 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { $twig->headerRate = $disciplineHandled; // Студенты Рё баллы - $students = $db->GetStudentsForDiscipline($this->UserInfo['TeacherID'], $id); + $students = $db->GetStudentsForRating($this->UserInfo['TeacherID'], $id); $studentsHandled = array(); - $i = 0; $MigrantsCount = 0; - + $i = 0; + foreach($students as $row) { - if ($row['isAttached'] == '0') { - // РќРµ Мигранты - $i++; - $studentsHandled[$i]['StudentID'] = $row['StudentID']; - $studentsHandled[$i]['LastName'] = $row['StudentLast']; - $studentsHandled[$i]['FirstName'] = $row['StudentFirst']; - $studentsHandled[$i]['SecondName'] = $row['StudentSecond']; - $studentsHandled[$i]['Grade'] = $row['Grade']; - $studentsHandled[$i]['GroupNum'] = $row['GroupNum']; - $rate = $db->getMapForStudent($row['StudentID'], $id); - $j = 0; - foreach($rate as $r) { - $j += 1; - $studentsHandled[$i][$j]['SubmoduleID'] = $r['SubmoduleID']; - $studentsHandled[$i][$j]['Rate'] = $r['Rate']; - } - $studentsHandled[$i]['RateCount'] = $j; - } - else { - // Мигранты - $MigrantsCount++; - $MigrantsHandled[$MigrantsCount]['StudentID'] = $row['StudentID']; - $MigrantsHandled[$MigrantsCount]['StudentID'] = $row['StudentID']; - $MigrantsHandled[$MigrantsCount]['LastName'] = $row['StudentLast']; - $MigrantsHandled[$MigrantsCount]['FirstName'] = $row['StudentFirst']; - $MigrantsHandled[$MigrantsCount]['SecondName'] = $row['StudentSecond']; - $MigrantsHandled[$MigrantsCount]['Grade'] = $row['Grade']; - $MigrantsHandled[$MigrantsCount]['GroupNum'] = $row['GroupNum']; - $rate = $db->getMapForStudent($row['StudentID'], $id); - $j = 0; - foreach($rate as $r) { - $j += 1; - $MigrantsHandled[$MigrantsCount][$j]['SubmoduleID'] = $r['SubmoduleID']; - $MigrantsHandled[$MigrantsCount][$j]['Rate'] = $r['Rate']; - } - $MigrantsHandled[$MigrantsCount]['RateCount'] = $j; + $i++; + $studentsHandled[$i]['StudentID'] = $row['StudentID']; + $studentsHandled[$i]['LastName'] = $row['LastName']; + $studentsHandled[$i]['FirstName'] = $row['FirstName']; + $studentsHandled[$i]['SecondName'] = $row['SecondName']; + $studentsHandled[$i]['Grade'] = $row['Grade']; + $studentsHandled[$i]['GroupNum'] = $row['GroupNum']; + $rate = $db->getMapForStudent($row['StudentID'], $id); + $j = 0; + foreach($rate as $r) { + $j += 1; + $studentsHandled[$i][$j]['SubmoduleID'] = $r['SubmoduleID']; + $studentsHandled[$i][$j]['Rate'] = $r['Rate']; } + $studentsHandled[$i]['RateCount'] = $j; } $twig->tableRate = $studentsHandled; - if (isset($MigrantsHandled)) - $twig->migrantsRate = $MigrantsHandled; $this->response->body($twig); } diff --git a/~dev_rating/application/classes/Model/Teacher/Map.php b/~dev_rating/application/classes/Model/Teacher/Map.php index 3b646738ea786b8c1919285ca28bcb0e771a9271..d09971e45ccde6bb3549a61675607ad2c9cd963b 100644 --- a/~dev_rating/application/classes/Model/Teacher/Map.php +++ b/~dev_rating/application/classes/Model/Teacher/Map.php @@ -8,6 +8,12 @@ class Model_Teacher_Map extends Model return DB::query(Database::SELECT, $sql)->execute(); } + public function getStudentsForDiscipline($teacherID, $disciplineID) + { + $sql = "CALL `getStudentsForDiscipline`('$teacherID', '$disciplineID'); "; + return DB::query(Database::SELECT, $sql)->execute(); + } + public function addModule($teacherID, $disciplineID, $order, $title) { $sql = "SELECT `AddModule`('$teacherID', '$disciplineID', '$order', '$title') AS `Num`;"; @@ -109,6 +115,12 @@ class Model_Teacher_Map extends Model $sql = "CALL `GetSubjects`(); "; return DB::query(Database::SELECT, $sql)->execute(); } + + public function GetStudyGroups($Grade, $FacultyID) + { + $sql = "CALL `GetStudyGroups`('$Grade', '$FacultyID'); "; + return DB::query(Database::SELECT, $sql)->execute(); + } public function ChangeModuleOrder($teacherID, $moduleID, $OrderNum) { @@ -121,4 +133,46 @@ class Model_Teacher_Map extends Model $sql = "SELECT `ChangeSubmoduleOrder`('$teacherID', '$SubmoduleID', '$OrderNum') AS `Num`;"; return DB::query(Database::SELECT, $sql)->execute(); } + + public function BindGroup($teacherID, $DisciplineID, $StudyGroupID) + { + $sql = "SELECT `BindGroup`('$teacherID', '$DisciplineID', '$StudyGroupID') AS `Num`;"; + return DB::query(Database::SELECT, $sql)->execute(); + } + + public function UnbindGroup($teacherID, $DisciplineID, $StudyGroupID) + { + $sql = "SELECT `UnbindGroup`('$teacherID', '$DisciplineID', '$StudyGroupID') AS `Num`;"; + return DB::query(Database::SELECT, $sql)->execute(); + } + + public function BindStudent($teacherID, $DisciplineID, $StudentID) + { + $sql = "SELECT `BindStudent`('$teacherID', '$DisciplineID', '$StudentID') AS `Num`;"; + return DB::query(Database::SELECT, $sql)->execute(); + } + + public function UnbindStudent($teacherID, $DisciplineID, $StudentID) + { + $sql = "SELECT `UnbindStudent`('$teacherID', '$DisciplineID', '$StudentID') AS `Num`;"; + return DB::query(Database::SELECT, $sql)->execute(); + } + + public function BindTeacher($AccessedTeacher, $BindingTeacher, $DisciplineID) + { + $sql = "SELECT `BindTeacher`('$AccessedTeacher', '$BindingTeacher', '$DisciplineID') AS `Num`;"; + return DB::query(Database::SELECT, $sql)->execute(); + } + + public function UnbindTeacher($AccessedTeacher, $BindingTeacher, $DisciplineID) + { + $sql = "SELECT `UnbindTeacher`('$AccessedTeacher', '$BindingTeacher', '$DisciplineID') AS `Num`;"; + return DB::query(Database::SELECT, $sql)->execute(); + } + + public function GetGroupsForDiscipline($DisciplineID) + { + $sql = "CALL `GetGroupsForDiscipline`('$DisciplineID'); "; + return DB::query(Database::SELECT, $sql)->execute(); + } } diff --git a/~dev_rating/application/classes/Model/Teacher/Rating.php b/~dev_rating/application/classes/Model/Teacher/Rating.php index dfe334ba8a0cd36f5e154439281c3a78d4589970..53d6170e30028ecb7710cad3855ab4b6cece409a 100644 --- a/~dev_rating/application/classes/Model/Teacher/Rating.php +++ b/~dev_rating/application/classes/Model/Teacher/Rating.php @@ -7,6 +7,12 @@ class Model_Teacher_Rating extends Model $sql = "CALL `getStudentsForDiscipline`('$teacherID', '$disciplineID'); "; return DB::query(Database::SELECT, $sql)->execute(); } + + public function GetStudentsForRating($teacherID, $disciplineID) + { + $sql = "CALL `GetStudentsForRating`('$teacherID', '$disciplineID'); "; + return DB::query(Database::SELECT, $sql)->execute(); + } public function getMapForDiscipline($teacherID, $disciplineID) { diff --git a/~dev_rating/application/logs/deleteThis.php b/~dev_rating/application/logs/deleteThis.php deleted file mode 100644 index 3ac00faa65fb817ea29da4755b6c823685234399..0000000000000000000000000000000000000000 --- a/~dev_rating/application/logs/deleteThis.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - diff --git a/~dev_rating/application/views/base.twig b/~dev_rating/application/views/base.twig index d59b2352c2d638e3cdfd1907b0b6410f7d2cf96f..63db7f3cd186ac87ecedc5c117462db161d7b7fb 100644 --- a/~dev_rating/application/views/base.twig +++ b/~dev_rating/application/views/base.twig @@ -35,8 +35,8 @@ {% endblock %} </div> </div> - <div id="footer_fixBug"></div> - <div class="footer"> + <div id="footer_fixBug" style="display: none"></div> + <div class="footer" style="display: none"> <a href='http://vk.com/itlab_mmcs'>IT-лаборатория мехмата ЮФУ © 2014</a> </div> </div> diff --git a/~dev_rating/application/views/student/index.twig b/~dev_rating/application/views/student/index.twig index 518ffb405060f638dde2c74d27f44b422bfcf67d..f90f83d9858630ec3f294a8fd0387198a2d3a6d5 100644 --- a/~dev_rating/application/views/student/index.twig +++ b/~dev_rating/application/views/student/index.twig @@ -33,6 +33,8 @@ {% block title %}РњРѕРё баллы{% endblock %} {% block media %} {# head -> css, js #} + {{ HTML.script('media/js/wnd/wnd.js')|raw }} + {{ HTML.style('media/js/wnd/wnd.css')|raw }} {{ HTML.style('media/css/results.css')|raw }} {% endblock %} diff --git a/~dev_rating/application/views/teacher/index.twig b/~dev_rating/application/views/teacher/index.twig index bdf702b7e0cc2df3b435ca5b98603475ef52b114..f231b1c68143e53bbe4d45785191daf8c6359c24 100644 --- a/~dev_rating/application/views/teacher/index.twig +++ b/~dev_rating/application/views/teacher/index.twig @@ -63,6 +63,7 @@ {% block main_top_title %}Дисциплины{% endblock %} {% block main_content %} + <div class="disciplines_wrapper"> {% for subject in content.Subjects %} {{ idx.outputSubject(subject, HTML) }} diff --git a/~dev_rating/application/views/teacher/map/EditDiscipline.twig b/~dev_rating/application/views/teacher/map/EditDiscipline.twig new file mode 100644 index 0000000000000000000000000000000000000000..c8beebbf70aa0f0664fdcd4d7f36a1cb1891cc06 --- /dev/null +++ b/~dev_rating/application/views/teacher/map/EditDiscipline.twig @@ -0,0 +1,71 @@ +{% extends 'teacher/map/MapBase' %} + +{% block title %}Конструктор РЈРљР”{% endblock %} {# head -> title #} + +{% block map_content %} + + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Выберите факультет:</div> + <div class="field"> + <select class="SelectDepartment default_select"> + <option value="{{ User.DepID }}">{{ User.DepName }}</option> + </select> + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Выберите предмет:</div> + <div class="field"> + <select class="SelectSubject default_select"> + <option value="0">-РќРµ выбран-</option> + {% for Subject in SubjectsList %} + <option value="{{ Subject.ID }}" {% if Discipline.SubjectID == Subject.ID %}selected{% endif %}>{{ Subject.Title }}</option> + {% endfor %} + </select> + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Выберите РєСѓСЂСЃ:</div> + <div class="field"> + <select class="SelectGrade default_select"> + <option value="0">-РќРµ выбран-</option> + {% for Grade in GradesList %} + <option value="{{ Grade.ID }}" {% if Grade.ID == Discipline.GradeID %}selected{% endif %}>{{ Grade.Title }}</option> + {% endfor %} + </select> + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Форма контроля:</div> + <div class="field"> + <input name="ExamType" type="radio" value="exam" {% if Discipline.ExamType == 'exam' %}checked{% endif %}> Ркзамен + <br><br> + <input name="ExamType" type="radio" value="credit" {% if Discipline.ExamType == 'credit' %}checked{% endif %}> Зачет + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Лекционных часов:</div> + <div class="field"> + <input class="InputLectionCount default_input_text" style="width: 50px;" value="{{ Discipline.LectureHours }}"> + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Практических часов:</div> + <div class="field"> + <input class="InputPracticeCount default_input_text" style="width: 50px;" value="{{ Discipline.PracticeHours }}"> + </div> + </div> + <button class="ChangeDiscipline default_BlueButton">Сохранить</button> + </div> + +{% endblock %} diff --git a/~dev_rating/application/views/teacher/map/EditGroups.twig b/~dev_rating/application/views/teacher/map/EditGroups.twig new file mode 100644 index 0000000000000000000000000000000000000000..9fa7b9717c659bac01da451dc465c2ed465e4613 --- /dev/null +++ b/~dev_rating/application/views/teacher/map/EditGroups.twig @@ -0,0 +1,24 @@ +{% extends 'teacher/map/MapBase' %} + +{% block title %}Конструктор РЈРљР”{% endblock %} {# head -> title #} + +{% block map_content %} + <p class="top_center_info" style="display: none">Учебная карта дисциплины РЅР° 1 семестр 2014 РіРѕРґР°</p> + <div class="ChangeStudyGroupDIV"> + <select class="SelectStudyGroup default_select"> + <option value="0">Выберите РіСЂСѓРїРїСѓ:</option> + {% for Group in StudyGroups %} + <option value="{{ Group.GroupID }}">Группа {{ Group.GroupNum }} - {{ Group.SpecName }}</option> + {% endfor %} + </select> + <button class="AttachGroupButton default_BlueButton">Прикрепить РіСЂСѓРїРїСѓ</button> + </div> + <div class="AttachedGroupsList"> + {% for Group in GroupsForDiscipline %} + <div class="AttachedGroup" id="{{ Group.GroupID }}"> + <div class="StudyGroupInfo">РљСѓСЂСЃ {{ Group.GroupGrade }}, Группа {{ Group.GroupNum }} - {{ Group.SpecName }}</div> + <div class="UnbindGroup">Отсоединить РіСЂСѓРїРїСѓ</div> + </div> + {% endfor %} + </div> +{% endblock %} diff --git a/~dev_rating/application/views/teacher/map/EditStructure.twig b/~dev_rating/application/views/teacher/map/EditStructure.twig new file mode 100644 index 0000000000000000000000000000000000000000..f1216f3482e30d7bbcb2d36398af40345c98e852 --- /dev/null +++ b/~dev_rating/application/views/teacher/map/EditStructure.twig @@ -0,0 +1,51 @@ +{% extends 'teacher/map/MapBase' %} + +{% block title %}Конструктор РЈРљР”{% endblock %} {# head -> title #} + +{% block map_content %} + <p class="top_center_info" style="display: none">Учебная карта дисциплины РЅР° 1 семестр 2014 РіРѕРґР°</p> + <div class="studyMap"> + <div class="name">Р’РёРґС‹ контрольных мероприятий</div> + <div class="currentControl">Текущий контроль</div> + <div class="landmarkControl">Рубежный контроль</div> + <div class="actions" style="text-align: right; padding-right: 30px;">Действия</div> + </div> + <div class="moduleList"> + {% for i in range(1, Map.ModulesCount) if Map.ModulesCount > 0 %} + <div class="moduleGroup" id="{{ Map[i].ModuleID }}"> + <div class="moduleHead"> + <div class="name"> + <input type="text" class="inputName ModuleName" value="{{ Map[i].ModuleTitle }}"> + </div> + <div class="currentControl">{{ Map[i].CurrentControl }}</div> + <div class="landmarkControl">{{ Map[i].LandmarkControl }}</div> + <div class="actions"> + <div class="deleteModule icon delete"></div> + <div class="downModule icon down"></div> + <div class="upModule icon up"></div> + <div class="addSubModule icon add"></div> + </div> + </div> + <div class="subModules"> + {% for j in range(1, Map[i].SubmodulesCount) if Map[i].SubmodulesCount > 0 %} + <div class="subModule" id="{{ Map[i][j].SubmoduleID }}"> + <div class="name"> + <input type="text" class="inputName SubmoduleName" value="{{ Map[i][j].Title }}"> + </div> + <div class="currentControl"><input type="text" class="inputCredit inputCurrentControl" value="{% if Map[i][j].SubmoduleControl == 'CurrentControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div> + <div class="landmarkControl"><input type="text" class="inputCredit inputLandmarkControl" value="{% if Map[i][j].SubmoduleControl == 'LandmarkControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div> + <div class="actions"> + <div class="deleteSubModule icon delete"></div> + <div class="downSubModule icon down"></div> + <div class="upSubModule icon up"></div> + </div> + </div> + {% endfor %} + </div> + </div> + {% else %} + <div class="empty">Пусто</div> + {% endfor %} + </div> + <div class="addModule">Добавить модуль</div> +{% endblock %} diff --git a/~dev_rating/application/views/teacher/map/EditStudents.twig b/~dev_rating/application/views/teacher/map/EditStudents.twig new file mode 100644 index 0000000000000000000000000000000000000000..0799e59cffa21786f1af8a248531611c3291e8e9 --- /dev/null +++ b/~dev_rating/application/views/teacher/map/EditStudents.twig @@ -0,0 +1,19 @@ +{% extends 'teacher/map/MapBase' %} + +{% block title %}Конструктор РЈРљР”{% endblock %} {# head -> title #} + +{% block map_content %} + <p class="top_center_info" style="display: none">Учебная карта дисциплины РЅР° 1 семестр 2014 РіРѕРґР°</p> + <div class="AttachedStudentsList"> + {% for Student in Students %} + <div id="{{ Student.StudentID }}" class="Student {% if Student.Type == detach %}StatusBind{% else %}StatusUnbind{% endif %}"> + <span class="Name">{{ Student.LastName }} {{ Student.FirstName }} {{ Student.SecondName }}</span> + {% if Student.Type == detach%} + <span class="action Action_UnbindStudent">Отсоединить студента</span> + {% else %} + <span class="action Action_BindStudent">Прикрепить студента</span> + {% endif %} + </div> + {% endfor %} + </div> +{% endblock %} diff --git a/~dev_rating/application/views/teacher/map/MapBase.twig b/~dev_rating/application/views/teacher/map/MapBase.twig new file mode 100644 index 0000000000000000000000000000000000000000..07c3a6263c17fbd0214520f60c42e312c528906b --- /dev/null +++ b/~dev_rating/application/views/teacher/map/MapBase.twig @@ -0,0 +1,27 @@ +{% extends 'base' %} + +{% block title %}Конструктор РЈРљР”{% endblock %} {# head -> title #} +{% block media %} {# head -> css, js #} + {{ HTML.script('media/js/functions.js')|raw }} + + {{ HTML.script('media/js/event_inspector/event_inspector.js')|raw }} + {{ HTML.style('media/js/event_inspector/event_inspector.css')|raw }} + + {{ HTML.style('media/css/construct.css')|raw }} + {{ HTML.script('media/js/construct/edit.js')|raw }} +{% endblock %} + +{% block main_top_title %}Редактирование РЈРљР”{% endblock %} +{% block main_content %} + <div class="tabs"> + <div class="tab">{{ HTML.anchor('map/discipline/'~Discipline.DisciplineID, 'Шаг 1. Базоые настройки РЈРљР”', {'title': 'Шаг 1. Базоые настройки РЈРљР”'})|raw }}</div> + <div class="tab">{{ HTML.anchor('map/structure/'~Discipline.DisciplineID, 'Шаг 2. Структура РЈРљР”', {'title': 'Шаг 2. Структура РЈРљР”'})|raw }}</div> + <div class="tab">{{ HTML.anchor('map/groups/'~Discipline.DisciplineID, 'Шаг 3. Прикрепление РіСЂСѓРїРї', {'title': 'Шаг 3. Прикрепление РіСЂСѓРїРї'})|raw }}</div> + <div class="tab">{{ HTML.anchor('map/students/'~Discipline.DisciplineID, 'Шаг 4. Прикрепление студентов', {'title': 'Шаг 4. Прикрепление студентов'})|raw }}</div> + </div> + <div class="map_content"> + {% block map_content %} + + {% endblock %} + </div> +{% endblock %} \ No newline at end of file diff --git a/~dev_rating/application/views/teacher/map/create.twig b/~dev_rating/application/views/teacher/map/create.twig index eec186a60ab3406637a106e7de942b3f3117ffa9..643007db708f0f6ac4d22f7beff8f62a588f605f 100644 --- a/~dev_rating/application/views/teacher/map/create.twig +++ b/~dev_rating/application/views/teacher/map/create.twig @@ -17,42 +17,72 @@ <p>Обратите внимание, что добавление Учебной Карты Дисциплины (далее РЈРљР”) РїСЂРѕРёСЃС…РѕРґРёС‚ РІ 3 этапа:</p> <ol> <li>Добавление базовых параметров дисциплины: выбор предмета, формы контроля Рё РґСЂ.;</li> - <li>РџСЂРёРІСЏР·РєР° РіСЂСѓРїРї Рё студентов Рє данной РЈРљР”;</li> - <li>Создание структуры РЈРљР” (Модули Рё мероприятия).</li> + <li>Создание структуры РЈРљР” (Модули Рё мероприятия), РїСЂРёРІСЏР·РєР° преподавателей.</li> + <li>РџСЂРёРІСЏР·РєР° РіСЂСѓРїРї Рё студентов Рє данной РЈРљР”;</li> </ol> </div> - <div class="discipline"> - <div class="section"> - <select class="SelectSubject"> - <option value="0">Выберите предмет:</option> - {% for Subject in SubjectsList %} - <option value="{{ Subject.ID }}">{{ Subject.Title }}</option> - {% endfor %} - </select> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Выберите факультет:</div> + <div class="field"> + <select class="SelectDepartment default_select"> + <option value="{{ User.DepID }}">{{ User.DepName }}</option> + </select> + </div> </div> - <div class="section"> - <select class="SelectDepartment"> - <option value="{{ User.DepID }}">{{ User.DepName }}</option> - </select> - <select class="SelectGrade"> - <option value="0">Выберите РєСѓСЂСЃ:</option> - {% for Grade in GradesList %} - <option value="{{ Grade.ID }}" >{{ Grade.Title }}</option> - {% endfor %} - </select> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Выберите предмет:</div> + <div class="field"> + <select class="SelectSubject default_select"> + <option value="0">Выберите предмет:</option> + {% for Subject in SubjectsList %} + <option value="{{ Subject.ID }}">{{ Subject.Title }}</option> + {% endfor %} + </select> + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Выберите РєСѓСЂСЃ:</div> + <div class="field"> + <select class="SelectGrade default_select"> + <option value="0">Выберите РєСѓСЂСЃ:</option> + {% for Grade in GradesList %} + <option value="{{ Grade.ID }}" >{{ Grade.Title }}</option> + {% endfor %} + </select> + </div> </div> - <div class="section"> - Контроль: - <input name="ExamType" type="radio" value="exam"> Ркзамен - <input name="ExamType" type="radio" value="credit"> Зачет + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Форма контроля:</div> + <div class="field"> + <input name="ExamType" type="radio" value="exam"> Ркзамен + <br><br> + <input name="ExamType" type="radio" value="credit"> Зачет + </div> </div> - <div class="section"> - <div class="item title">Лекционных часов:</div> - <div class="item"><input class="InputLectionCount" style="width: 50px;" value="0"></div> - <div class="item title">Практических часов:</div> - <div class="item"><input class="InputPracticeCount" style="width: 50px;" value="0"></div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Лекционных часов:</div> + <div class="field"> + <input class="InputLectionCount default_input_text" style="width: 50px;" value="0"> + </div> + </div> + </div> + <div class="LayerSection"> + <div class="itemBlock"> + <div class="title">Практических часов:</div> + <div class="field"> + <input class="InputPracticeCount default_input_text" style="width: 50px;" value="0"> + </div> </div> - <button class="AddDiscipline">Добавить</button> + <button class="AddDiscipline default_BlueButton">Добавить</button> </div> {% endblock %} diff --git a/~dev_rating/application/views/teacher/map/edit.twig b/~dev_rating/application/views/teacher/map/edit.twig index 06fde9fc481e972e767b1dfd21756213e1199ead..ae9474bcd3ae898eafa499d1c81c1da4c292b8d0 100644 --- a/~dev_rating/application/views/teacher/map/edit.twig +++ b/~dev_rating/application/views/teacher/map/edit.twig @@ -21,7 +21,8 @@ <div class="tab step_4">Шаг 4<span class="desc">. Прикрепление студентов</span></div> </div> <p class="top_center_info" style="display: none">Учебная карта дисциплины РЅР° 1 семестр 2014 РіРѕРґР°</p> - <div class="discipline"> + + <div class="discipline_page"> <div class="section"> <select class="SelectSubject"> <option value="0">Выберите предмет:</option> @@ -54,7 +55,8 @@ </div> <button class="ChangeDiscipline">Сохранить</button> </div> - <div class="structure"> + + <div class="structure_page"> <div class="studyMap"> <div class="name">Р’РёРґС‹ контрольных мероприятий</div> <div class="currentControl">Текущий контроль</div> @@ -100,4 +102,38 @@ </div> <div class="addModule">Добавить модуль</div> </div> + + <div class="groups_page"> + <select class="SelectStudyGroup"> + <option value="0">Выберите РіСЂСѓРїРїСѓ:</option> + {% for Group in StudyGroups %} + <option value="{{ Group.GroupID }}">Группа {{ Group.GroupNum }} - {{ Group.SpecName }}</option> + {% endfor %} + </select> + <button class="AttachGroupButton">Прикрепить РіСЂСѓРїРїСѓ</button> + <div class="AttachedGroupsList"> + {% for Group in GroupsForDiscipline %} + <div class="" id="{{ Group.GroupID }}"> + РљСѓСЂСЃ - {{ Group.GroupGrade }}, Группа - {{ Group.GroupNum }} + <div class="UnbindGroup">Отсоединить РіСЂСѓРїРїСѓ</div> + </div> + {% endfor %} + </div> + </div> + + <div class="students_page"> + <div class="AttachedStudentsList"> + {% for Student in Students %} + <div id="{{ Student.StudentID }}" class="Student {% if Student.Type == detach %}StatusBind{% else %}StatusUnbind{% endif %}"> + <span class="Name">{{ Student.LastName }} {{ Student.FirstName }} {{ Student.SecondName }}</span> + {% if Student.Type == detach%} + <span class="Action_UnbindStudent">Отсоединить студента</span> + {% else %} + <span class="Action_BindStudent">Прикрепить студента</span> + {% endif %} + </div> + {% endfor %} + </div> + </div> + {% endblock %} diff --git a/~dev_rating/application/views/teacher/setRate.twig b/~dev_rating/application/views/teacher/setRate.twig index 59663696e7de5f2942a213802ff08356ad04d651..593ebcabe4e9dcea09ea8dc296a0c7ec26aedd8e 100644 --- a/~dev_rating/application/views/teacher/setRate.twig +++ b/~dev_rating/application/views/teacher/setRate.twig @@ -4,6 +4,9 @@ {% block media %} {# head -> css, js #} {{ HTML.script('media/js/functions.js')|raw }} + {{ HTML.script('media/js/event_inspector/event_inspector.js')|raw }} + {{ HTML.style('media/js/event_inspector/event_inspector.css')|raw }} + {{ HTML.style('media/css/setRate.css')|raw }} {{ HTML.script('media/js/setRate.js')|raw }} {% endblock %} @@ -14,7 +17,7 @@ <p style="font-size: 15px; margin-left: 2.5%">Обратить внимание, что пустая клетка эквивалентна нулю</p> <table class="studentsRate" border="0" cellspacing="0" cellpadding="0"> <tr> - <td class="title" width="150px">Модуль/номер</td> + <td class="title" width="150px">Модуль</td> {% for i in 1..headerRate.ModulesCount %} <td class="subject" colspan="{{headerRate[i].SubmodulesCount}}">{{ headerRate[i].ModuleTitle }}</td> {% endfor %} @@ -46,26 +49,5 @@ {% endfor %} </tr> {% endfor %} - {% set GroupNum = 0 %} - {% for student in migrantsRate %} - {% if loop.first == 1 %} - <tr> - <td class="group" colspan="{{ CellCount + 1 }}">Мигранты</td> - </tr> - {% endif %} - {% set row = row + 1 %} - {% if student.GroupNum != GroupNum %} - {% set GroupNum = student.GroupNum %} - <tr> - <td class="group" colspan="{{ CellCount + 1 }}">{{ student.GroupNum }} РіСЂСѓРїРїР°</td> - </tr> - {% endif %} - <tr> - <td class="row_{{ row }} student" id="{{ student.StudentID }}">{{ student.LastName }} {{ student.FirstName }}</td> - {% for i in 1..CellCount %} - <td class="row_{{ row }} col_{{ i }} rateCell {% if student[i].Rate > 0 %}edit{% endif %}"><input value="{{ student[i].Rate }}"></td> - {% endfor %} - </tr> - {% endfor %} </table> {% endblock %} \ No newline at end of file diff --git a/~dev_rating/deploy.php b/~dev_rating/deploy.php new file mode 100644 index 0000000000000000000000000000000000000000..bd691ffee9c65058a9da69c1654824366b4d1666 --- /dev/null +++ b/~dev_rating/deploy.php @@ -0,0 +1,21 @@ +<?php defined('SYSPATH') OR die('No direct access allowed.'); + + if(!is_dir(APPPATH.'config')) + { + mkdir(APPPATH.'config'); + if(!copy(CFGPATH.'database.php', APPPATH.'config/database.php')) + echo 'Беда!'; + if(!copy(CFGPATH.'security.php', APPPATH.'config/security.php')) + echo 'Беда!'; + if(!copy(CFGPATH.'twig.php', APPPATH.'config/twig.php')) + echo 'Беда!'; + } + + if(!is_dir(APPPATH.'logs/')) + mkdir(APPPATH.'logs'); + + if(!is_dir(APPPATH.'cache/')) + { + mkdir(APPPATH.'cache'); + mkdir(APPPATH.'cache/twig'); + } \ No newline at end of file diff --git a/~dev_rating/application/config/database.php b/~dev_rating/deployConfig/database.php similarity index 100% rename from ~dev_rating/application/config/database.php rename to ~dev_rating/deployConfig/database.php diff --git a/~dev_rating/application/config/security.php b/~dev_rating/deployConfig/security.php similarity index 100% rename from ~dev_rating/application/config/security.php rename to ~dev_rating/deployConfig/security.php diff --git a/~dev_rating/application/config/twig.php b/~dev_rating/deployConfig/twig.php similarity index 94% rename from ~dev_rating/application/config/twig.php rename to ~dev_rating/deployConfig/twig.php index 7e7ddc2e6b673f7715aab2f65038c7915c0bd90c..3705682b8333792cd15243c60889c5f9ed4ec75b 100644 --- a/~dev_rating/application/config/twig.php +++ b/~dev_rating/deployConfig/twig.php @@ -19,7 +19,7 @@ return array( 'auto_reload' => (Kohana::$environment == Kohana::DEVELOPMENT), 'autoescape' => TRUE, 'base_template_class' => 'Twig_Template', - 'cache' => TWIGPATH.'cache', + 'cache' => APPPATH.'cache/twig', 'charset' => 'utf-8', 'optimizations' => -1, 'strict_variables' => FALSE, diff --git a/~dev_rating/index.php b/~dev_rating/index.php index 30b21e52dc932485e3ec071da09c15cc717b3a47..82fd3794dcff1df330c5e450a5f17121453bf544 100644 --- a/~dev_rating/index.php +++ b/~dev_rating/index.php @@ -23,6 +23,13 @@ $modules = 'modules'; */ $system = 'system'; +/** + * Директория, РІ которой содержатся конфиги, используемые РїСЂРё деплое. + * + * @link http://kohanaframework.org/guide/about.install#system + */ +$deployConfig = 'deployConfig'; + /** * The default extension of resource files. If you change this, all resources * must be renamed to use the new extension. @@ -69,13 +76,18 @@ if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules)) if ( ! is_dir($system) AND is_dir(DOCROOT.$system)) $system = DOCROOT.$system; +// Make the configs relative to the docroot, for symlink'd index.php +if ( ! is_dir($deployConfig) AND is_dir(DOCROOT.$deployConfig)) + $deployConfig = DOCROOT.$deployConfig; + // Define the absolute paths for configured directories define('APPPATH', realpath($application).DIRECTORY_SEPARATOR); define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR); define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR); +define('CFGPATH', realpath($deployConfig).DIRECTORY_SEPARATOR); // Clean up the configuration vars -unset($application, $modules, $system); +unset($application, $modules, $system, $deployConfig); if (file_exists('install'.EXT)) { @@ -83,6 +95,12 @@ if (file_exists('install'.EXT)) return include 'install'.EXT; } +if (file_exists('deploy'.EXT)) +{ + // Load the deploy check + include 'deploy'.EXT; +} + /** * Define the start time of the application, used for profiling. */ diff --git a/~dev_rating/media/css/base.css b/~dev_rating/media/css/base.css index 011faa2d81e865e6b530c41f6b5558113074bb92..6f0d858e7c697c69037184e7ec4851f8fb9b7a2a 100644 --- a/~dev_rating/media/css/base.css +++ b/~dev_rating/media/css/base.css @@ -4,9 +4,8 @@ padding: 0; border: 0; } -/* Для корректного отображения РѕРєРѕРЅ */ html, -body { +body { /* Для корректного отображения РѕРєРѕРЅ */ height: 100%; } body { @@ -27,6 +26,44 @@ a:link { a:hover { text-decoration: underline } +/* default classes */ +.default_input_text { + border: 1px solid #d7d7d7; + box-sizing: border-box; + padding: 5px; + font-size: 15px; + color: #303030; + line-height: 140% +} +.default_input_text:hover { + border: 1px solid #3399CC; +} +.default_select { + padding: 5px; + border: 1px solid #d7d7d7; + background: #ffffff; + font-size: 0.8em; +} + .default_select option { + padding: 1px 10px; + } +.default_BlueButton { + display: inline-block; + border: 0; + padding: 6px 20px; + background: #3A84A6; + font-weight: bold; + font-size: 13px; + color: #ffffff; + border-radius: 3px; + moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; +} + .default_BlueButton:hover { + background: #3399CC; + cursor: pointer; + } /*-----------------------------------HEAD-------------------------------------------------*/ .header_wrapper { diff --git a/~dev_rating/media/css/construct.css b/~dev_rating/media/css/construct.css index 3c01c5e60db329bb7366216ca0c9dfda963b4ec7..18fb68fabfe51c86a39b451b1ed5e21bef9247e3 100644 --- a/~dev_rating/media/css/construct.css +++ b/~dev_rating/media/css/construct.css @@ -19,62 +19,67 @@ /* -- Вкладки РЅР° странице -------------------- */ .tabs { - margin-left: 25px; + margin: 10px 25px; } .tabs .tab { display: inline; float: left; - background: #EEEEEE; - padding: 5px 12px; margin-right: 2px; - font-size: 13px; - color: #333; - cursor: pointer } - .tabs .tab:hover { - background-color: #3399CC; - color: #f6f7f7; - } - .tabs .tab.active { - background-color: #3399CC; - color: #f6f7f7; - } - -.discipline { - display: none; + .tabs .tab a:link{ + display: block; + background: #EEEEEE; + padding: 5px 12px; + font-size: 13px; + color: #333; + } + .tabs .tab a:hover { + background-color: #3399CC; + text-decoration: none; + color: #f6f7f7; + } + .tabs .tab a.active { + background-color: #3399CC; + color: #f6f7f7; + } +.map_content { margin: 0px 25px; } -.discipline .top_center_info { - text-align: center; -} -.discipline .section { - margin: 10px 0px; + + +/* Базовые настройки дисциплины */ +.LayerSection { + position: relative; + margin: 0 auto; + margin-bottom: 10px; + width: 500px; } - .discipline .section .item{ - display: inline; - float: left; - margin-right: 20px; + /* Подсказка */ + .LayerSection .help{ + margin: 10px 0; + text-align: center; font-size: 15px; } - .discipline .section .item.title{ - } - .discipline .section select { - padding: 5px; - border: 1px solid #d7d7d7; - background: #ffffff; - font-size: 0.8em; + .LayerSection .itemBlock { + margin: 15px 0px; } - - - -.structure { - margin: 0px 25px; -} - - .structure .empty { - display: block; + .LayerSection .itemBlock .title { + display: inline; + float: left; + padding-top: 4px; + width: 200px; + font-size: 15px; + color: #555; + } + .LayerSection .itemBlock .field { + display: inline; + float: left; + width: 300px + } + .ChangeDiscipline { + margin-left: 200px } -/* Шапка "таблицы" учебной карты */ +/* ===> Шапка "таблицы" учебной карты */ .studyMap { padding: 6px 15px; margin-top: 5px; @@ -175,3 +180,58 @@ font-weight: bold; } +/* Прикрипление РіСЂСѓРїРї */ +.ChangeStudyGroupDIV{ + margin: 10px 0 5px 0; + padding: 10px; + background: #f4f4f4; +} +.ChangeStudyGroupDIV select{ + float: left; + width: 740px +} +.ChangeStudyGroupDIV button{ + float: right +} +.AttachedGroupsList {} + .AttachedGroupsList .AttachedGroup { + margin: 15px 0px; + padding: 10px; + background: #f4f4f4; + } + .AttachedGroupsList .AttachedGroup .StudyGroupInfo{ + float: left; + font-size: 15px; + color: #363636; + } + .AttachedGroupsList .AttachedGroup .UnbindGroup{ + float: right; + font-size: 15px; + color: #363636; + cursor: pointer + } + .AttachedGroupsList .AttachedGroup .UnbindGroup:hover{ + color: #FF0000; + } +/* Прикрипление студентов */ +.AttachedStudentsList {} + .AttachedStudentsList .Student { + margin: 10px 0; + padding: 10px; + } + .AttachedStudentsList .Student .Name { + float: left; + font-size: 14px; + color: #363636; + } + .AttachedStudentsList .Student .action { + float: right; + font-size: 14px; + cursor: pointer + } + .StatusBind { + background: #CCFF99; + } + .StatusUnbind { + background: #F3C0C0; + } diff --git a/~dev_rating/media/js/construct/attach.js b/~dev_rating/media/js/construct/attach.js index d43933f423e5874566560515f3ffdd55d1bf1c86..3d7d97c7d371c1c339fe0a7f8224a79c956e241a 100644 --- a/~dev_rating/media/js/construct/attach.js +++ b/~dev_rating/media/js/construct/attach.js @@ -1,16 +1,4 @@ var $ = jQuery; $(function() { - var URL = (window.location.href).split('/'); - var DisciplineID = URL[URL.length - 1] - - // Открыть РѕРєРЅРѕ 'Прикрепить РіСЂСѓРїРїС‹' - $('.AttachGroups').click(function(){ - wnd.open({title: 'Тестовое eeeeeРѕРєРЅРѕ', content: '<p>Theew text</p>', width: 700}); - }); - - // Открыть РѕРєРЅРѕ 'Прикрепить студентов' - $('.AttachStudents').click(function(){ - wnd.open({title: 'Тестовое eeeeeРѕРєРЅРѕ', content: '<p>Theew text</p>', width: 700}); - }); }) \ No newline at end of file diff --git a/~dev_rating/media/js/construct/create.js b/~dev_rating/media/js/construct/create.js index 7f122b4cb26751277dc83270a5df7180dc0d35cb..5644574d5041734ee18e3df9586521f104e01fff 100644 --- a/~dev_rating/media/js/construct/create.js +++ b/~dev_rating/media/js/construct/create.js @@ -18,7 +18,7 @@ $(function() { if(data.success === true) { $('.AddDiscipline').hide(); EventInspector_ShowMsg('РћРє, AddDiscipline', 'success'); - setTimeout('location.replace("/~dev_rating/map/'+data.DisciplineID+'")',5000); + setTimeout('location.replace("/~dev_rating/map/'+data.DisciplineID+'")',1000); } else EventInspector_ShowMsg('Error, AddDiscipline', 'error'); } ); diff --git a/~dev_rating/media/js/construct/edit.js b/~dev_rating/media/js/construct/edit.js index e315dabdfaa1763e214ead2c66510a9bc341adde..dae6bbc59e30a3b2501fb485fc02a2761377730f 100644 --- a/~dev_rating/media/js/construct/edit.js +++ b/~dev_rating/media/js/construct/edit.js @@ -3,22 +3,6 @@ $(function() { var URL = (window.location.href).split('/'); var DisciplineID = URL[URL.length - 1] - // Вкладки - $('.tab').click(function(){ - $('.tab').each(function(){ - $(this).removeClass('active'); - }); - $(this).addClass('active'); - $('.discipline').hide(); - $('.structure').hide(); - }); - $('.step_1').click(function(){ - $('.discipline').show(); - }); - $('.step_2').click(function(){ - $('.structure').show(); - }); - // Шаблон мероприятия function GetSubModuleTmp(){ return '\ @@ -465,4 +449,106 @@ $(function() { KeyDownOnlyNumber(event); }); +// ------ Прикрипление студентов/РіСЂСѓРїРї/преподавателей -- + +function BindGroup(id){ + return '\ + <div class="AttachedGroup" id="'+ id +'">\ + РљСѓСЂСЃ - , Группа - \ + <div class="UnbindGroup">Отсоединить РіСЂСѓРїРїСѓ</div>\ + </div>'; +} + +// Прикрепить РіСЂСѓРїРїСѓ +$('.AttachGroupButton').click(function(){ + var StudyGroupID = $('.SelectStudyGroup').val(); + $.post( + '/~dev_rating/handler/map/BindGroup', + { + 'StudyGroupID': StudyGroupID, + 'DisciplineID': DisciplineID + }, + function(data){ + data = $.parseJSON(data); + if(data.success === true) + EventInspector_ShowMsg('РћРє, BindGroup', 'success'); + else EventInspector_ShowMsg('Error, BindGroup', 'error'); + } + ); + $('.AttachedGroupsList').append(BindGroup(StudyGroupID)); +}); + +// Отсоединить РіСЂСѓРїРїСѓ +$('.AttachedGroupsList').on('click', '.UnbindGroup', function(){ + var StudyGroupID = $(this).parent().attr('id'); + var GroupDIV = $(this).parent(); + $.post( + '/~dev_rating/handler/map/UnbindGroup', + { + 'StudyGroupID': StudyGroupID, + 'DisciplineID': DisciplineID + }, + function(data){ + data = $.parseJSON(data); + if(data.success === true) { + GroupDIV.remove(); + EventInspector_ShowMsg('РћРє, BindGroup', 'success'); + } + else EventInspector_ShowMsg('Error, BindGroup', 'error'); + } + ); +}); + +// Прикрепить студента +$('.AttachedStudentsList').on('click', '.Action_BindStudent', function(){ + $(this) + .removeClass('Action_BindStudent') + .addClass('Action_UnbindStudent') + .text('Отсоединить студента'); + $(this) + .parent() + .removeClass('StatusUnbind') + .addClass('StatusBind'); + var ID = $(this).parent().attr('id'); + $.post( + '/~dev_rating/handler/map/BindStudent', + { + 'StudentID': ID, + 'DisciplineID': DisciplineID + }, + function(data){ + data = $.parseJSON(data); + if(data.success === true) + EventInspector_ShowMsg('РћРє, BindStudent', 'success'); + else EventInspector_ShowMsg('Error, BindStudent', 'error'); + } + ); +}); + +// Отсоединить студента +$('.AttachedStudentsList').on('click', '.Action_UnbindStudent', function(){ + $(this) + .removeClass('Action_UnbindStudent') + .addClass('Action_BindStudent') + .text('Прикрепить студента'); + $(this) + .parent() + .removeClass('StatusBind') + .addClass('StatusUnbind'); + var ID = $(this).parent().attr('id'); + $.post( + '/~dev_rating/handler/map/UnbindStudent', + { + 'StudentID': ID, + 'DisciplineID': DisciplineID + }, + function(data){ + data = $.parseJSON(data); + if(data.success === true) + EventInspector_ShowMsg('РћРє, UnbindStudent', 'success'); + else EventInspector_ShowMsg('Error, UnbindStudent', 'error'); + } + ); +}); + }); diff --git a/~dev_rating/media/js/index_student.js b/~dev_rating/media/js/index_student.js new file mode 100644 index 0000000000000000000000000000000000000000..14c7ad184464cea09bf413fdccb9cbc7572c4123 --- /dev/null +++ b/~dev_rating/media/js/index_student.js @@ -0,0 +1,37 @@ +var $ = jQuery; +$(function() { + + wnd.open({title: "Цветовая схема", content: " + <style> + .color-red { + background-color: #fdd; + } + .color-yellow { + background-color: #ffd; + } + .color-green { + background-color: #dfd; + } + </style> + <p>Цветовая схема характеризует успеваемость студента РїРѕ каждой дисциплине. <span class=\"color-red\">Красный</span> - студент РЅРµ успевает РїРѕ этой дисциплине, <span class=\"color-yellow\">желтый</span> - отстает, РЅРѕ имеет возможность добрать баллы Рё сдать дисциплину, <span class=\"color-green\">зеленый</span> - студент успевает.<p> + <h1>Дисциплина СЃ зачетом</h1> + <table> + <tr class=\"color-red\"><td>0-30 баллов</tr> + <tr class=\"color-yellow\"><td>31-60 баллов</tr> + <tr class=\"color-green\"><td>61-100 баллов</tr> + </table> + <h1>Дисциплина СЃ экзаменом</h1> + <p>РІРѕ время семестра:</p> + <table> + <tr class=\"color-red\"><td>0-30 баллов</tr> + <tr class=\"color-yellow\"><td>31-38 баллов</tr> + <tr class=\"color-green\"><td>39-60 баллов</tr> + </table> + <p>РІРѕ время сессии для допущенных Рє экзамену (39 Рё более баллов Р·Р° семестр):</p> + <table> + <tr class=\"color-red\"><td>0-21 баллов</tr> + <tr class=\"color-green\"><td>22-40 баллов</tr> + </table> + ", width: 700}); + +}) \ No newline at end of file diff --git a/~dev_rating/media/js/setRate.js b/~dev_rating/media/js/setRate.js index 49e37497f125a4b00bbfb9fc51e1765a956b12f2..482ddea140e70ba1fb94258ad945a2fcce2407c3 100644 --- a/~dev_rating/media/js/setRate.js +++ b/~dev_rating/media/js/setRate.js @@ -52,20 +52,28 @@ $(function() { if (edit) { $.post('/~dev_rating/handler/rating/changeRate', {'student': StudentID, 'submodule': SubmoduleID, 'rate': NewRate }, function(data){ - alert(data); + data = $.parseJSON(data); + if(data.success === true) + EventInspector_ShowMsg('Балл изменен', 'success'); + else EventInspector_ShowMsg('РќРµ удалось изменить балл', 'error'); } ); } else { $.post('/~dev_rating/handler/rating/setRate', {'student': StudentID, 'submodule': SubmoduleID, 'rate': NewRate }, function(data){ - alert(data); + data = $.parseJSON(data); + if(data.success === true) + EventInspector_ShowMsg('Балл добавлен', 'success'); + else EventInspector_ShowMsg('РќРµ удалось добавить балл', 'error'); } ); } } - else - alert('Текущий балл превышает максимальный для данного модуля.'); + else { + thisObj.children('input').val('0'); + EventInspector_ShowMsg('Текущий балл превышает максимальный для данного модуля', 'error'); + } } $('.rateCell').mouseenter(function(){ @@ -97,6 +105,11 @@ $(function() { tdUnFocus($(this)); }); + // РџСЂРё нажатие РЅР° элемент rateCell дочерный input получает фокус + $('.rateCell ').click(function(){ + $(this).children('input').focus(); + } ); + // Р’ inputCredit (РіРґРµ баллы вводить) разрешаем вводить только цифры $('.rateCell').children('input').keydown(function(event) { KeyDownOnlyNumber(event); diff --git a/~dev_rating/media/js/sign.js b/~dev_rating/media/js/sign.js index a0ba06ffe4446f7493ae57b9676d00c46579392d..ab0e57c9ef69d366e931844c3db460c1fb8b979a 100644 --- a/~dev_rating/media/js/sign.js +++ b/~dev_rating/media/js/sign.js @@ -54,7 +54,7 @@ $(function() }); }); - $(document).keypress(function(event){ + $(document).keypress(function(){ if(event.keyCode==13) { $('#signin_b').trigger('click'); diff --git a/~dev_rating/media/js/wnd/wnd.css b/~dev_rating/media/js/wnd/wnd.css index 7563d252a53a03e3356d98422d64b31d6abdcbeb..fc339564dc2105874a0cc0e30cb156348741314a 100644 --- a/~dev_rating/media/js/wnd/wnd.css +++ b/~dev_rating/media/js/wnd/wnd.css @@ -1,43 +1,68 @@ .window { - display: none; - position: absolute; - top: 0; - left: 0; - z-index: 1000; - width: 100%; - height: 100%; - background-color: rgba(0,0,0,.5); - font-family: sans-serif; + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 1000; + width: 100%; + height: 100%; + background-color: rgba(0,0,0,.7); + font-family: sans-serif; } .window-shadow { - position: absolute; - width: 100%; - height: 100%; + position: absolute; + width: 100%; + height: 100%; } .window-block { - position: relative; - z-index: 1; - margin: 20px auto; - background-color: #fff; + position: relative; + z-index: 1; + margin: 29px auto 19px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px } .window-title { - line-height: 20px; - font-size: 13px; - text-align: center; + position: absolute; + min-width: 150px; + margin-top: -15px; + margin-left: -5px; + padding: 5px 20px; + background-color: #39c; + font-size: 21px; + color: #fff; + box-shadow: 0 0 6px #555; } .window-close { - position: absolute; - top: 0; - right: 0; - display: block; - width: 20px; - height: 20px; - background: url("close.png") center; + position: absolute; + top: 3px; + right: 3px; + display: block; + width: 20px; + height: 20px; + background: url("close.png") center; } .window-content { - padding: 5px 10px; + padding: 30px 15px 10px; } .window-content p { - line-height: 16px; - font-size: 14px; - } \ No newline at end of file + margin-bottom: 5px; + line-height: 16px; + font-size: 14px; + } + .window-content h1 { + margin-bottom: 5px; + padding-top: 5px; + line-height: 16px; + font-size: 15px; + } + .window-content table { + margin-bottom: 5px; + border-collapse: collapse; + } + .window-content td { + padding: 0 10px; + line-height: 20px; + font-size: 14px; + border: 1px solid black; + } \ No newline at end of file diff --git a/~dev_rating/media/js/wnd/wnd.js b/~dev_rating/media/js/wnd/wnd.js index 302449b2cebed1fa85cdf54a5acfeabb529ec043..a433a32f3b274c1213203ca2fd85f0fe3c9ae193 100644 --- a/~dev_rating/media/js/wnd/wnd.js +++ b/~dev_rating/media/js/wnd/wnd.js @@ -25,7 +25,7 @@ wnd.open = function(data) { wnd.show(); wnd.$.window.css("min-width", wnd.$.block.width() + 40); - wnd.$.window.css("min-height", wnd.$.block.height() + 40); + wnd.$.window.css("min-height", wnd.$.block.height() + 50); } wnd.close = wnd.hide; diff --git a/~dev_rating/modules/kotwig/cache/deleteThis.php b/~dev_rating/modules/kotwig/cache/deleteThis.php deleted file mode 100644 index 3ac00faa65fb817ea29da4755b6c823685234399..0000000000000000000000000000000000000000 --- a/~dev_rating/modules/kotwig/cache/deleteThis.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -