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

1. Убрал повторный ввод E-Mail на странице активации

2. Создал класс-фабрику DataArray для получения обработанных данных различных типов
parent a109833f
Branches
Tags
No related merge requests found
Showing
with 210 additions and 18 deletions
...@@ -109,17 +109,6 @@ class Controller_Handler_AdmTeachers extends Controller_Handler { ...@@ -109,17 +109,6 @@ class Controller_Handler_AdmTeachers extends Controller_Handler {
public function action_getDepartmentsList() public function action_getDepartmentsList()
{ {
$facultyID = $this->post->offsetGet('facultyID'); $facultyID = $this->post->offsetGet('facultyID');
if($facultyID != 0) $this->response->body(DataArray::factory('Departments')->byFaculty($facultyID));
{
$departaments = $this->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));
}
} }
} }
\ No newline at end of file
...@@ -40,8 +40,7 @@ class Controller_Handler_Sign extends Controller_Handler { ...@@ -40,8 +40,7 @@ class Controller_Handler_Sign extends Controller_Handler {
->rule('password', 'min_length', array(':value', $config['password']['length'])) ->rule('password', 'min_length', array(':value', $config['password']['length']))
->rule('confirm_password', 'matches', array(':validation', 'confirm_password', 'password')) ->rule('confirm_password', 'matches', array(':validation', 'confirm_password', 'password'))
->rule('email', 'not_empty') ->rule('email', 'not_empty')
->rule('email', 'email') ->rule('email', 'email');
->rule('confirm_email', 'matches', array(':validation', 'confirm_email', 'email'));
if($this->post->check()) if($this->post->check())
{ {
list($response['success'], $attempt) = User::instance() list($response['success'], $attempt) = User::instance()
...@@ -76,6 +75,4 @@ class Controller_Handler_Sign extends Controller_Handler { ...@@ -76,6 +75,4 @@ class Controller_Handler_Sign extends Controller_Handler {
{ {
} }
} }
\ No newline at end of file
<?php
class DataArr_Departments {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Departments;
}
public function byFaculty($facultyID)
{
if($facultyID != 0)
{
$departaments = $this->model->getDepartmentsByFaculty($facultyID);
$departamentsHandled = array(); $i = 0;
foreach($departaments as $row)
{
$i++;
$departamentsHandled[$i]['ID'] = $row['DepID'];
$departamentsHandled[$i]['Name'] = $row['DepName'];
}
return $departamentsHandled;
}
}
}
<?php
class DataArr_Disciplines {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Disciplines;
}
// TODO: Методы для получения списка дисциплин
}
\ No newline at end of file
<?php
class DataArr_Faculties {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Faculties;
}
// TODO: Метод для получения факультетов
}
\ No newline at end of file
<?php
class DataArr_JobPositions {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_JobPositions;
}
// TODO: Метод для получения должностных позиций
}
<?php
class DataArr_Semesters {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Semesters;
}
// TODO: Методы для получения семестров
}
<?php
class DataArr_Specializations {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Specializations;
}
// TODO: Метод для получения списка специализаций
}
\ No newline at end of file
<?php
class DataArr_Students {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Students;
}
// TODO: Методы для получения студентов
}
<?php
class DataArr_StudyGroups {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_StudyGroups;
}
// TODO: Методы для получения списка учебных групп
}
\ No newline at end of file
<?php
class DataArr_Teachers {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Teachers;
}
public function byFacutly($facultyID)
{
if($facultyID != 0)
{
$teachers = $this->model->getTeachersByFaculty($facultyID);
$i = 0;
foreach($teachers as $row)
{
$i++;
$teachersHandled[$i]['ID'] = $row['TeacherID'];
$teachersHandled[$i]['FirstName'] = $row['TeacherFirst'];
$teachersHandled[$i]['SecondName'] = $row['TeacherSecond'];
$teachersHandled[$i]['LastName'] = $row['TeacherLast'];
$teachersHandled[$i]['JobPositionName'] = $row['JobPositionName'];
$teachersHandled[$i]['DepartmentID'] = $row['DepID'];
$teachersHandled[$i]['DepartmentName'] = $row['DepName'];
}
}
return $teachersHandled;
}
public function byDepartment($departmentID)
{
$teachers = $this->model->getTeachersByDepartment($departmentID);
$i = 0;
foreach($teachers as $row)
{
$i++;
$teachersHandled[$i]['ID'] = $row['TeacherID'];
$teachersHandled[$i]['FirstName'] = $row['TeacherFirst'];
$teachersHandled[$i]['SecondName'] = $row['TeacherSecond'];
$teachersHandled[$i]['LastName'] = $row['TeacherLast'];
$teachersHandled[$i]['JobPositionName'] = $row['JobPositionName'];
$teachersHandled[$i]['DepartmentName'] = $row['DepName'];
}
return $teachersHandled;
}
public function forDiscipline($disciplineID, $asConcat = false, $asInitials = false)
{
$teachers = $this->model->getTeachersForDiscipline($disciplineID);
$teachersHandled = array(); $i = 0;
foreach ($teachers as $teacher)
{
$i++; $tchr = array();
$tchr['LastName'] = $teacher['TeacherLast'];
$tchr['FirstName'] = $asInitials ?
UTF8::substr($teacher['TeacherFirst'], 0, 1).'. ' : $teacher['TeacherFirst'];
if(!empty($teacher['TeacherSecond']))
$tchr['SecondName'] = $asInitials ?
UTF8::substr($teacher['TeacherSecond'], 0, 1).'. ' : $teacher['TeacherSecond'];
if($asConcat)
$teachersHandled[$i] = $tchr['LastName'].$tchr['FirstName'].$tchr['SecondName'];
else
$teachersHandled[$i] = $tchr;
}
return $teachersHandled;
}
}
<?php
class DataArr_Tickets {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Tickets;
}
public function forAccount($accountID)
{
}
public function forAdministrator()
{
}
}
<?php defined('SYSPATH') or die('No direct script access.');
class DataArray
{
public static function factory($type = NULL) {
if($type == NULL)
return false;
else
{
$className = 'DataArray_'.$type;
return new $className();
}
}
}
\ No newline at end of file
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<div class="inputGroup_title"> <div class="inputGroup_title">
Место работы Место работы
</div> </div>
<a href="settings.twig"></a>
<div class="inputGroup_input"> <div class="inputGroup_input">
<select id="jobPositionSelect"> <select id="jobPositionSelect">
<option value="0">--- Академическая должность ---</option> <option value="0">--- Академическая должность ---</option>
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
<select id="facultySelect"> <select id="facultySelect">
<option value="0">--- Подразделение ЮФУ ---</option> <option value="0">--- Подразделение ЮФУ ---</option>
{% for row in Faculties %} {% for row in Faculties %}
<option value="{{ row.ID }}">{{ row.Name }} ({{ row.Abbr }})</option> <option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }} ({{ row.Abbr }})</option>
{% endfor %} {% endfor %}
</select> </select>
<select id="departmentSelect"> <select id="departmentSelect">
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
{{ sign.input('password', 'password', '', 'Пароль') }} {{ sign.input('password', 'password', '', 'Пароль') }}
{{ sign.input('confirm_password', 'password', '', 'Подтверждение пароля') }} {{ sign.input('confirm_password', 'password', '', 'Подтверждение пароля') }}
{{ sign.input('email', 'text', '', 'E-Mail адрес') }} {{ sign.input('email', 'text', '', 'E-Mail адрес') }}
{{ sign.input('confirm_email', 'text', '', 'Подтверждение E-Mail адреса') }}
</div> </div>
{{ sign.input('signup_b', 'button', 'Активировать') }} {{ sign.input('signup_b', 'button', 'Активировать') }}
</form> </form>
......
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