Skip to content
Snippets Groups Projects
Commit c1189de6 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

FIX: adding teachers by full name, job title, job status and dep id only closes #328

parent f93fa1d9
Branches
Tags
No related merge requests found
......@@ -76,8 +76,11 @@ class Controller_Api_V0_Teacher extends Controller_Handler_Api {
$teacher = $teacher->inila($teacherData->inila);
}
$teacher = $teacher->create();
return (int)$teacher->ID;
if (isset($teacher->ActivationCode)) {
return [(int)$teacher->ID, $teacher->ActivationCode];
} else {
return (int)$teacher->ID;
}
}
private function updateTeacher($teacherData) {
......
......@@ -71,6 +71,9 @@ class Model_Teacher extends Model_Container
->parameters($this->data)
->execute()->get('ID');
} else {
if (!isset($this->data["DepID"])) {
$this->DepID = $this->data['FacultyID'];
}
$sql = 'SELECT * FROM Teacher_Create(LastName, FirstName, SecondName, JobPositionID, DepID,
ActivationCode) AS "ID"';
......
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