Skip to content
Snippets Groups Projects
Commit 3e9585db authored by Andrew Rudenets's avatar Andrew Rudenets
Browse files

FIX: кафедры

parent a82498ec
No related merge requests found
...@@ -79,19 +79,7 @@ class Controller_Handler_Settings extends Controller_Handler { ...@@ -79,19 +79,7 @@ class Controller_Handler_Settings extends Controller_Handler {
public function action_getDepartmentsList() public function action_getDepartmentsList()
{ {
$facultyID = $this->post->offsetGet('facultyID'); $facultyID = $this->post->offsetGet('facultyID');
if($facultyID != 0) DataArray::factory('Departments')->byFaculty($facultyID)->asArray();
{
$model = new Model_Admin_Teachers;
$departaments = $model->getDepartmentsByFaculty($facultyID);
$departamentsHandled = array(); $i = 0;
foreach($departaments as $row)
{
$i++;
$departamentsHandled[$i]['ID'] = $row['DepID'];
$departamentsHandled[$i]['Name'] = $row['DepName'];
}
$this->response->body(json_encode($departamentsHandled));
}
} }
public function action_changeEMail() public function action_changeEMail()
......
...@@ -6,7 +6,7 @@ class Controller_Teacher_Profile extends Controller_UserEnvi { ...@@ -6,7 +6,7 @@ class Controller_Teacher_Profile extends Controller_UserEnvi {
$twig = Twig::factory('profile/settings'); $twig = Twig::factory('profile/settings');
$twig->JobPositions = $this->getJobPositions(); $twig->JobPositions = $this->getJobPositions();
$twig->Faculties = $this->getFaculties(); $twig->Faculties = $this->getFaculties();
$twig->Departments = DataArray::factory('Departments')->byFaculty($this->UserInfo['FacultyID']); $twig->Departments = DataArray::factory('Departments')->byFaculty($this->UserInfo['FacultyID'])->asArray();
$twig->User = $this->UserInfo; $twig->User = $this->UserInfo;
$this->response->body($twig); $this->response->body($twig);
} }
......
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