Skip to content
Snippets Groups Projects
Commit de91e8e9 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

fix empty fullnames on rating page. fix teacher search on teacher binding...

fix empty fullnames on rating page. fix teacher search on teacher binding page. fix undefined vars in sql
parent a8dc9d63
Branches
Tags
No related merge requests found
......@@ -2016,6 +2016,7 @@ CREATE FUNCTION `CreateRecoveryToken`
NO SQL
BEGIN
DECLARE vAccountID INT DEFAULT -1;
DECLARE vUserFullName TEXT;
DECLARE EXIT HANDLER FOR SQLEXCEPTION RETURN -1;
# get account ID
......@@ -2024,15 +2025,15 @@ BEGIN
WHERE accounts.EMail = pAccountOrEMail
LIMIT 1;
IF vAccountID <= 0 THEN
RETURN "";
RETURN '';
END IF;
SET UserFullName = GetUserFullNameByAccountID(accID);
IF UserFullName IS NULL OR UserFullName = "" THEN
RETURN "";
SET vUserFullName = GetUserFullNameByAccountID(vAccountID);
IF vUserFullName IS NULL OR vUserFullName = '' THEN
RETURN '';
END IF;
# transform all unsed recovery tokens into used
# transform all unused recovery tokens into used
UPDATE `recovery_tokens`
SET recovery_tokens.isUsed = 1
WHERE recovery_tokens.isUsed = 0;
......@@ -2040,36 +2041,37 @@ BEGIN
# handle catch constraints violations
INSERT INTO `recovery_tokens`
(AccountID, Token )
VALUES (accID, Token);
RETURN UserFullName;
VALUES (vAccountID, Token);
RETURN vUserFullName;
END//
DROP FUNCTION IF EXISTS GetUserFullNameByAccountID//
CREATE FUNCTION `GetUserFullNameByAccountID` ( `AccountID` INT(11)
) RETURNS VARCHAR(255) charset utf8
CREATE FUNCTION `GetUserFullNameByAccountID`
( `pAccountID` INT(11)) RETURNS VARCHAR(255) charset utf8
NO SQL
BEGIN
DECLARE UserFullName VARCHAR(255);
DECLARE checker INT;
DECLARE vUserFullName VARCHAR(255);
DECLARE vChecker INT DEFAULT -1;
SET checker = -1;
SELECT students.ID As ID, CONCAT(students.LastName," ",students.FirstName," ",students.SecondName) As UserName
INTO checker, UserFullName
SELECT students.ID As ID, CONCAT(students.LastName,' ',students.FirstName,' ',students.SecondName) As UserName
INTO vChecker, vUserFullName
FROM `students`
WHERE students.AccountID = AccountID
WHERE students.AccountID = pAccountID
LIMIT 1;
IF checker <= 0 THEN
SELECT teachers.ID As ID, CONCAT(teachers.LastName," ",teachers.FirstName," ",teachers.SecondName) As UserName
INTO checker, UserFullName
IF vChecker <= 0 THEN
SELECT teachers.ID As ID, CONCAT(teachers.LastName,' ',teachers.FirstName,' ',teachers.SecondName) As UserName
INTO vChecker, vUserFullName
FROM `teachers`
WHERE teachers.AccountID = AccountID
WHERE teachers.AccountID = pAccountID
LIMIT 1;
IF checker <= 0 THEN
RETURN "";
IF vChecker <= 0 THEN
RETURN '';
END IF;
END IF;
RETURN UserFullName;
RETURN vUserFullName;
END//
DROP FUNCTION IF EXISTS UseRecoveryToken//
......
......@@ -122,7 +122,7 @@
{% set row = row + 1 %}
{% set j = 0 %}
<tr id="row_{{ row }}" class="group_{{ group.GroupID }}">
<td id="student_{{ student.ID }}" class="studentCell staticCell">{{ student.Last }} {{ student.First }}</td>
<td id="student_{{ student.ID }}" class="studentCell staticCell">{{ student.LastName }} {{ student.FirstName }}</td>
{% for i in 1..CellCount %}
{% set j = j + 1 %}
{% if student.Rates[i].SubmoduleID >= 0 and disciplineInfo.isMilestone == 0 %}
......
......@@ -37,9 +37,6 @@ $(function() {
The better solution: use list.js extension, and load the whole list with the first page load.
*/
var source = jNameFilterInput.val();
if (source.length == 0)
return;
var name = source.split(" ");
$.post(
URLdir + "handler/map/SearchTeachers",
......
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