Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
grade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Yushko
grade
Commits
eaf6b480
Commit
eaf6b480
authored
10 years ago
by
RomanSteinberg
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfix/search_students' into develop
parents
d9a45625
46c0a2e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
db/StoredFunctions.sql
+19
-28
19 additions, 28 deletions
db/StoredFunctions.sql
~dev_rating/media/js/discipline/EditStudents.js
+3
-2
3 additions, 2 deletions
~dev_rating/media/js/discipline/EditStudents.js
~dev_rating/media/js/rating.js
+5
-14
5 additions, 14 deletions
~dev_rating/media/js/rating.js
with
27 additions
and
44 deletions
db/StoredFunctions.sql
+
19
−
28
View file @
eaf6b480
...
...
@@ -668,7 +668,7 @@ CREATE FUNCTION `CreateStudent`
) RETURNS int(11)
NO SQL
BEGIN
DECLARE vAccountID, vGroupID, vStudentID INT DEFAULT -1;
DECLARE vAccountID, vGroupID, vStudentID
, vSemesterID
INT DEFAULT -1;
DECLARE EXIT HANDLER FOR SQLEXCEPTION RETURN -1;
# find group
...
...
@@ -693,10 +693,16 @@ BEGIN
(AccountID, LastName, FirstName, SecondName)
VALUES (vAccountID, pLastName, pFirstName, pSecondName);
SELECT general_settings.Val INTO vSemesterID
FROM `general_settings`
WHERE general_settings.Name = '
SemesterID
'
LIMIT 1;
# bind group in current semester
INSERT INTO `students_groups`
(StudentID, GroupID, SemesterID)
VALUES (LAST_INSERT_ID(), vGroupID,
@Current
SemesterID);
VALUES (LAST_INSERT_ID(), vGroupID,
v
SemesterID);
RETURN 0;
END //
...
...
@@ -767,24 +773,7 @@ BEGIN
SET
vGroupID
=
LAST_INSERT_ID
();
END
IF
;
#
TODO
:
user
roles
#
create
account
INSERT
INTO
`accounts`
(
Login
,
Password
,
EMail
,
UserRoleID
,
ActivationCode
)
VALUES
(
NULL
,
NULL
,
NULL
,
1
,
pActivationCode
);
SET
vAccountID
=
LAST_INSERT_ID
();
#
create
student
INSERT
INTO
`students`
(
AccountID
,
LastName
,
FirstName
,
SecondName
)
VALUES
(
vAccountID
,
pLastName
,
pFirstName
,
pSecondName
);
#
bind
group
in
current
semester
INSERT
INTO
`students_groups`
(
StudentID
,
GroupID
,
SemesterID
)
VALUES
(
LAST_INSERT_ID
(),
vGroupID
,
@
CurrentSemesterID
);
RETURN
ROW_COUNT
()
-
1
;
RETURN
CreateStudent
(
pLastName
,
pFirstName
,
pSecondName
,
vGradeID
,
pGroupNum
,
pFacultyID
,
pActivationCode
);
END
//
...
...
@@ -2214,13 +2203,14 @@ CREATE FUNCTION `CreateRecoveryToken`
NO SQL
BEGIN
DECLARE vAccountID INT DEFAULT -1;
DECLARE vUserFullName TEXT;
DECLARE EXIT HANDLER FOR SQLEXCEPTION RETURN -
1
;
DECLARE vUserFullName TEXT
charset utf8
;
DECLARE EXIT HANDLER FOR SQLEXCEPTION RETURN -
2
;
# get account ID
SELECT accounts.ID INTO vAccountID
FROM `accounts`
WHERE accounts.EMail = pAccountOrEMail
WHERE accounts.EMail = pAccountOrEMail OR
accounts.Login = pAccountOrEMail
LIMIT 1;
IF vAccountID <= 0 THEN
RETURN
''
;
...
...
@@ -2234,12 +2224,13 @@ BEGIN
# transform all unused recovery tokens into used
UPDATE `recovery_tokens`
SET recovery_tokens.isUsed = 1
WHERE recovery_tokens.isUsed = 0;
WHERE recovery_tokens.isUsed = 0 AND
recovery_tokens.AccountID = vAccountID;
# handle catch constraints violations
INSERT INTO `recovery_tokens`
( AccountID, Token )
VALUES (vAccountID, Token);
VALUES (vAccountID,
p
Token);
RETURN vUserFullName;
END//
...
...
@@ -2248,7 +2239,7 @@ CREATE FUNCTION `GetUserFullNameByAccountID`
( `pAccountID` INT(11)) RETURNS VARCHAR(255) charset utf8
NO SQL
BEGIN
DECLARE vUserFullName VARCHAR(255);
DECLARE vUserFullName VARCHAR(255)
charset utf8
;
DECLARE vChecker INT DEFAULT -1;
SELECT students.ID As ID, CONCAT(students.LastName,'
',students.FirstName,'
',students.SecondName) As UserName
...
...
This diff is collapsed.
Click to expand it.
~dev_rating/media/js/discipline/EditStudents.js
+
3
−
2
View file @
eaf6b480
...
...
@@ -91,7 +91,8 @@ $(function() {
},
function
(
searchResult
){
var
searchResult
=
$
.
parseJSON
(
searchResult
);
var
i
=
0
;
console
.
log
(
searchResult
);
var
i
=
-
1
;
jSearchResult
.
html
(
""
);
var
jClone
=
jSearchResult
.
clone
();
...
...
@@ -112,7 +113,7 @@ $(function() {
jCurGroup
.
append
(
jTempStudent
);
}
if
(
i
<=
0
)
{
if
(
searchResult
.
length
<=
0
)
{
jSearchResult
.
append
(
jStudentEmptyPrototype
.
clone
());
}
else
{
jSearchResult
.
replaceWith
(
jClone
);
...
...
This diff is collapsed.
Click to expand it.
~dev_rating/media/js/rating.js
+
5
−
14
View file @
eaf6b480
...
...
@@ -188,6 +188,9 @@ $(function() {
var
newRate
=
0
;
if
(
jThis
.
children
(
"
input
"
).
val
()
!==
""
)
newRate
=
parseInt
(
jThis
.
children
(
"
input
"
).
val
());
if
(
newRate
==
oldRate
)
return
;
var
rateResult
=
newRate
;
// считаем баллы по строке
...
...
@@ -321,19 +324,7 @@ $(function() {
$
(
"
.commonCell
"
).
focusout
(
function
(){
g_isFocusCell
=
false
;
var
newRate
=
0
;
//alert(123);
if
(
$
(
this
).
children
(
"
input
"
).
val
()
!==
""
)
{
newRate
=
parseInt
(
$
(
this
).
children
(
"
input
"
).
val
());
if
(
newRate
!=
oldRate
)
{
Rating
(
$
(
this
),
oldRate
);
}
}
TdUnFocus
();
UnsetTdInfo
(
$
(
this
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment