Skip to content
Snippets Groups Projects
Commit 47c9777f authored by Artem Konenko's avatar Artem Konenko
Browse files

#215 Preparing release 2.0.3

* Fix Departments_Get procedure name
* Update version in package.json and fix warnings about missing some information in the file
* Add nginx config file
* Fix count form for JobPosition_Create method
* Fix names of db migrations
* Extract error handling function for page with tokens
* Fix comment for auth tokens handler controller
* Add comment about field `status` in Teacher's model and rename the corresponding parameter in `changeInfo` to `isWorking`
parent 5b6ba765
Branches release/issue215_2_0_3
Tags
No related merge requests found
......@@ -24,7 +24,7 @@ BEGIN
END//
DROP PROCEDURE IF EXISTS Departments_Get//
CREATE PROCEDURE GetDepartments (IN pFacultyID INT)
CREATE PROCEDURE Departments_Get (IN pFacultyID INT)
READS SQL DATA
BEGIN
IF pFacultyID <=> 0 THEN
......@@ -84,8 +84,8 @@ BEGIN
WHERE job_positions.Name = pJobPositionName;
END//
DROP FUNCTION IF EXISTS JobPositions_Create //
CREATE FUNCTION JobPositions_Create (
DROP FUNCTION IF EXISTS JobPosition_Create //
CREATE FUNCTION JobPosition_Create (
pJobPositionName varchar(200) CHARSET utf8
) RETURNS INT(11) # -1 or id
NO SQL
......
server {
# listen 80 default;
server_name grade.sfedu.ru www.grade.sfedu.ru;
root /http/grade/site/;
index index.php index.html index.htm;
# autotranslate nginx configuration
location /application {
rewrite ^/\b.* /~dev_rating/index.php/$1 break;
}
location /modules {
rewrite ^/\b.* /~dev_rating/index.php/$1 break;
}
location /system {
rewrite ^/\b.* /~dev_rating/index.php/$1 break;
}
#location ~ \.* {
# deny all;
#}
# /autotranslate
location /sync {
proxy_pass http://127.0.0.1:3986;
rewrite ^/sync/?(.*) /$1 break;
}
location ~ \.php$ {
fastcgi_buffers 8 256k;
fastcgi_buffer_size 128k;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
location / {
try_files $uri $uri/ /index.php;
}
}
\ No newline at end of file
$(() => {
const errorHandling = function (jqXHR) {
let status = parseInt(jqXHR.status);
if (status == 403) {
Popup.error('Недостаточно прав');
return;
}
try {
if (status != 400) throw null;
let message = JSON.parse(jqXHR.responseText).message;
if (!message) throw null;
Popup.error(message);
} catch (error) {
Popup.error('Не удалось добавить токен');
}
};
$('#createToken').click(function () {
$(this).prop('disabled', true);
$.getJSON(URLdir + 'handler/authTokens/create').success(result => {
Popup.success('Токен добавлен');
location.reload();
}).fail(jqXHR => {
let status = parseInt(jqXHR.status);
if (status == 403) {
Popup.error('Недостаточно прав');
return;
}
try {
if (status != 400) throw null;
let message = JSON.parse(jqXHR.responseText).message;
if (!message) throw null;
Popup.error(message);
} catch (error) {
Popup.error('Не удалось добавить токен');
}
}).always(() => $(this).prop('disabled', false));
}).fail(errorHandling).always(() => $(this).prop('disabled', false));
});
$('.officeList').on('click', '.deleteToken', function (event) {
......@@ -35,20 +37,6 @@ $(() => {
$row.remove();
if (!$body.children().length) $body.append('<tr><td colspan="6" class="empty">Нет записей</td></tr>');
Popup.success('Токен удален');
}).fail(jqXHR => {
let status = parseInt(jqXHR.status);
if (status == 403) {
Popup.error('Недостаточно прав');
return;
}
try {
if (status != 400) throw null;
let message = JSON.parse(jqXHR.responseText).message;
if (!message) throw null;
Popup.error(message);
} catch (error) {
Popup.error('Не удалось удалить токен');
}
}).always(() => $(this).prop('disabled', false));
}).fail(errorHandling).always(() => $(this).prop('disabled', false));
});
});
\ No newline at end of file
{
"name": "GradeRatingSystem",
"version": "2.0.1",
"version": "2.0.3",
"description": "Web-service for sfedu grade system",
"license": "UNLICENSED",
"private": true,
"repository": {
"type": "git",
"url": "git@gitlab.mmcs.sfedu.ru:it-lab/grade.git"
},
"devDependencies": {
"babel-preset-es2015": "6",
"babel-preset-es2015-without-strict": "0",
......
<?php defined('SYSPATH') or die('No direct script access.');
/** Получение списка групп, курсов, предметов, и т.д. */
/** Управление токенами авторизации */
class Controller_Handler_AuthTokens extends Controller_Handler
{
public function before() {
......
......@@ -76,7 +76,7 @@ class Model_Faculties extends Model
}
public static function createJobPosition($jobPositionName) {
$sql = 'SELECT `JobPositions_Create`(:name) AS `ID`;';
$sql = 'SELECT `JobPosition_Create`(:name) AS `ID`;';
$id = DB::query(Database::SELECT, $sql)
->param(':name', $jobPositionName)
->execute();
......
......@@ -17,6 +17,7 @@
* @property $FacultyID int
* @property $FacultyName string
* @property $FacultyAbbr string
* @property $Status bool Is the teacher working now or not?
* @property-read $ActivationCode string #todo: add field
*/
class Model_Teacher extends Model_Container
......@@ -74,7 +75,7 @@ class Model_Teacher extends Model_Container
}
public function changeInfo($lastName, $firstName, $secondName, $degreeID, $departmentID, $status=true) {
public function changeInfo($lastName, $firstName, $secondName, $degreeID, $departmentID, $isWorking=true) {
$sql = 'SELECT `ChangeTeacherInfo`(:id, :last, :first, :second, :degree, :department, :status) AS `Num`';
$res = DB::query(Database::SELECT, $sql)
->parameters([
......@@ -84,7 +85,7 @@ class Model_Teacher extends Model_Container
':second' => $secondName,
':degree' => $degreeID,
':department' => $departmentID,
':status' => $status,
':status' => $isWorking,
])->execute()->get('Num');
return ($res == 0);
}
......
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