mirror of https://github.com/acanas/swad-core.git
Version 20.51.41: Mar 24, 2021 Course user settings database table renamed.
This commit is contained in:
parent
6dddb7b0f1
commit
b4e5e64e4d
28
sql/swad.sql
28
sql/swad.sql
|
@ -352,6 +352,18 @@ CREATE TABLE IF NOT EXISTS crs_records (
|
||||||
Txt TEXT NOT NULL,
|
Txt TEXT NOT NULL,
|
||||||
UNIQUE INDEX(FieldCod,UsrCod));
|
UNIQUE INDEX(FieldCod,UsrCod));
|
||||||
--
|
--
|
||||||
|
-- Table crs_requests: stores requests for enrollment in courses
|
||||||
|
--
|
||||||
|
CREATE TABLE IF NOT EXISTS crs_requests (
|
||||||
|
ReqCod INT NOT NULL AUTO_INCREMENT,
|
||||||
|
CrsCod INT NOT NULL DEFAULT -1,
|
||||||
|
UsrCod INT NOT NULL,
|
||||||
|
Role TINYINT NOT NULL DEFAULT 0,
|
||||||
|
RequestTime DATETIME NOT NULL,
|
||||||
|
UNIQUE INDEX(ReqCod),
|
||||||
|
UNIQUE INDEX(CrsCod,UsrCod),
|
||||||
|
INDEX(UsrCod));
|
||||||
|
--
|
||||||
-- Table crs_users: stores who users belong to what courses
|
-- Table crs_users: stores who users belong to what courses
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS crs_users (
|
CREATE TABLE IF NOT EXISTS crs_users (
|
||||||
|
@ -368,9 +380,9 @@ CREATE TABLE IF NOT EXISTS crs_users (
|
||||||
INDEX(CrsCod,Role),
|
INDEX(CrsCod,Role),
|
||||||
INDEX(UsrCod,Role));
|
INDEX(UsrCod,Role));
|
||||||
--
|
--
|
||||||
-- Table crs_usr_last: stores last prefs of users in courses
|
-- Table crs_user_settings: stores last settings (preferences) of users in courses
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS crs_usr_last (
|
CREATE TABLE IF NOT EXISTS crs_user_settings (
|
||||||
UsrCod INT NOT NULL,
|
UsrCod INT NOT NULL,
|
||||||
CrsCod INT NOT NULL,
|
CrsCod INT NOT NULL,
|
||||||
LastDowGrpCod INT NOT NULL DEFAULT -1,
|
LastDowGrpCod INT NOT NULL DEFAULT -1,
|
||||||
|
@ -384,18 +396,6 @@ CREATE TABLE IF NOT EXISTS crs_usr_last (
|
||||||
ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',
|
ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',
|
||||||
UNIQUE INDEX(UsrCod,CrsCod));
|
UNIQUE INDEX(UsrCod,CrsCod));
|
||||||
--
|
--
|
||||||
-- Table crs_requests: stores requests for enrollment in courses
|
|
||||||
--
|
|
||||||
CREATE TABLE IF NOT EXISTS crs_requests (
|
|
||||||
ReqCod INT NOT NULL AUTO_INCREMENT,
|
|
||||||
CrsCod INT NOT NULL DEFAULT -1,
|
|
||||||
UsrCod INT NOT NULL,
|
|
||||||
Role TINYINT NOT NULL DEFAULT 0,
|
|
||||||
RequestTime DATETIME NOT NULL,
|
|
||||||
UNIQUE INDEX(ReqCod),
|
|
||||||
UNIQUE INDEX(CrsCod,UsrCod),
|
|
||||||
INDEX(UsrCod));
|
|
||||||
--
|
|
||||||
-- Table ctr_centers: centers (faculties, schools...)
|
-- Table ctr_centers: centers (faculties, schools...)
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS ctr_centers (
|
CREATE TABLE IF NOT EXISTS ctr_centers (
|
||||||
|
|
|
@ -1049,7 +1049,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
|
||||||
|
|
||||||
/***** Remove user from the tables of courses and users *****/
|
/***** Remove user from the tables of courses and users *****/
|
||||||
DB_QueryDELETE ("can not remove a user from all courses",
|
DB_QueryDELETE ("can not remove a user from all courses",
|
||||||
"DELETE FROM crs_usr_last"
|
"DELETE FROM crs_user_settings"
|
||||||
" WHERE UsrCod=%ld",
|
" WHERE UsrCod=%ld",
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
DB_QueryDELETE ("can not remove a user from all courses",
|
DB_QueryDELETE ("can not remove a user from all courses",
|
||||||
|
|
|
@ -600,13 +600,17 @@ TODO: Salvador Romero Cort
|
||||||
|
|
||||||
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.51.40 (2021-03-24)"
|
#define Log_PLATFORM_VERSION "SWAD 20.51.41 (2021-03-24)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
|
Version 20.51.41: Mar 24, 2021 Course user settings database table renamed. (? lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
RENAME TABLE crs_usr_last TO crs_user_settings;
|
||||||
|
|
||||||
Version 20.51.40: Mar 24, 2021 Course requests database table renamed. (308671 lines)
|
Version 20.51.40: Mar 24, 2021 Course requests database table renamed. (308671 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
RENAME TABLE crs_usr_requests TO crs_requests;
|
RENAME TABLE crs_usr_requests TO crs_requests;
|
||||||
|
|
|
@ -2058,7 +2058,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
||||||
|
|
||||||
/***** Remove possible users remaining in the course (teachers) *****/
|
/***** Remove possible users remaining in the course (teachers) *****/
|
||||||
DB_QueryDELETE ("can not remove users from a course",
|
DB_QueryDELETE ("can not remove users from a course",
|
||||||
"DELETE FROM crs_usr_last"
|
"DELETE FROM crs_user_settings"
|
||||||
" WHERE CrsCod=%ld",
|
" WHERE CrsCod=%ld",
|
||||||
CrsCod);
|
CrsCod);
|
||||||
DB_QueryDELETE ("can not remove users from a course",
|
DB_QueryDELETE ("can not remove users from a course",
|
||||||
|
|
|
@ -830,6 +830,30 @@ mysql> DESCRIBE crs_records;
|
||||||
"Txt TEXT NOT NULL," // Cns_MAX_BYTES_TEXT
|
"Txt TEXT NOT NULL," // Cns_MAX_BYTES_TEXT
|
||||||
"UNIQUE INDEX(FieldCod,UsrCod))");
|
"UNIQUE INDEX(FieldCod,UsrCod))");
|
||||||
|
|
||||||
|
/***** Table crs_requests *****/
|
||||||
|
/*
|
||||||
|
mysql> DESCRIBE crs_requests;
|
||||||
|
+-------------+------------+------+-----+---------+----------------+
|
||||||
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
|
+-------------+------------+------+-----+---------+----------------+
|
||||||
|
| ReqCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||||
|
| CrsCod | int(11) | NO | MUL | -1 | |
|
||||||
|
| UsrCod | int(11) | NO | MUL | NULL | |
|
||||||
|
| Role | tinyint(4) | NO | | 0 | |
|
||||||
|
| RequestTime | datetime | NO | | NULL | |
|
||||||
|
+-------------+------------+------+-----+---------+----------------+
|
||||||
|
5 rows in set (0.01 sec)
|
||||||
|
*/
|
||||||
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_requests ("
|
||||||
|
"ReqCod INT NOT NULL AUTO_INCREMENT,"
|
||||||
|
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||||
|
"UsrCod INT NOT NULL,"
|
||||||
|
"Role TINYINT NOT NULL DEFAULT 0,"
|
||||||
|
"RequestTime DATETIME NOT NULL,"
|
||||||
|
"UNIQUE INDEX(ReqCod),"
|
||||||
|
"UNIQUE INDEX(CrsCod,UsrCod),"
|
||||||
|
"INDEX(UsrCod))");
|
||||||
|
|
||||||
/***** Table crs_users *****/
|
/***** Table crs_users *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE crs_users;
|
mysql> DESCRIBE crs_users;
|
||||||
|
@ -857,9 +881,9 @@ mysql> DESCRIBE crs_users;
|
||||||
"INDEX(CrsCod,Role),"
|
"INDEX(CrsCod,Role),"
|
||||||
"INDEX(UsrCod,Role))");
|
"INDEX(UsrCod,Role))");
|
||||||
|
|
||||||
/***** Table crs_usr_last *****/
|
/***** Table crs_user_settings *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE crs_usr_last;
|
mysql> DESCRIBE crs_user_settings;
|
||||||
+----------------+---------------------------+------+-----+------------+-------+
|
+----------------+---------------------------+------+-----+------------+-------+
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
+----------------+---------------------------+------+-----+------------+-------+
|
+----------------+---------------------------+------+-----+------------+-------+
|
||||||
|
@ -877,7 +901,7 @@ mysql> DESCRIBE crs_usr_last;
|
||||||
+----------------+---------------------------+------+-----+------------+-------+
|
+----------------+---------------------------+------+-----+------------+-------+
|
||||||
11 rows in set (0.00 sec)
|
11 rows in set (0.00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_usr_last ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_user_settings ("
|
||||||
"UsrCod INT NOT NULL,"
|
"UsrCod INT NOT NULL,"
|
||||||
"CrsCod INT NOT NULL,"
|
"CrsCod INT NOT NULL,"
|
||||||
"LastDowGrpCod INT NOT NULL DEFAULT -1,"
|
"LastDowGrpCod INT NOT NULL DEFAULT -1,"
|
||||||
|
@ -891,30 +915,6 @@ mysql> DESCRIBE crs_usr_last;
|
||||||
"ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',"
|
"ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',"
|
||||||
"UNIQUE INDEX(UsrCod,CrsCod))");
|
"UNIQUE INDEX(UsrCod,CrsCod))");
|
||||||
|
|
||||||
/***** Table crs_requests *****/
|
|
||||||
/*
|
|
||||||
mysql> DESCRIBE crs_requests;
|
|
||||||
+-------------+------------+------+-----+---------+----------------+
|
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
|
||||||
+-------------+------------+------+-----+---------+----------------+
|
|
||||||
| ReqCod | int(11) | NO | PRI | NULL | auto_increment |
|
|
||||||
| CrsCod | int(11) | NO | MUL | -1 | |
|
|
||||||
| UsrCod | int(11) | NO | MUL | NULL | |
|
|
||||||
| Role | tinyint(4) | NO | | 0 | |
|
|
||||||
| RequestTime | datetime | NO | | NULL | |
|
|
||||||
+-------------+------------+------+-----+---------+----------------+
|
|
||||||
5 rows in set (0.01 sec)
|
|
||||||
*/
|
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_requests ("
|
|
||||||
"ReqCod INT NOT NULL AUTO_INCREMENT,"
|
|
||||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
|
||||||
"UsrCod INT NOT NULL,"
|
|
||||||
"Role TINYINT NOT NULL DEFAULT 0,"
|
|
||||||
"RequestTime DATETIME NOT NULL,"
|
|
||||||
"UNIQUE INDEX(ReqCod),"
|
|
||||||
"UNIQUE INDEX(CrsCod,UsrCod),"
|
|
||||||
"INDEX(UsrCod))");
|
|
||||||
|
|
||||||
/***** Table ctr_centers *****/
|
/***** Table ctr_centers *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE ctr_centers;
|
mysql> DESCRIBE ctr_centers;
|
||||||
|
|
|
@ -305,7 +305,7 @@ void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
|
||||||
|
|
||||||
/***** Register last prefs in current course in database *****/
|
/***** Register last prefs in current course in database *****/
|
||||||
DB_QueryINSERT ("can not register user in course",
|
DB_QueryINSERT ("can not register user in course",
|
||||||
"INSERT INTO crs_usr_last"
|
"INSERT INTO crs_user_settings"
|
||||||
" (UsrCod,CrsCod,"
|
" (UsrCod,CrsCod,"
|
||||||
"LastDowGrpCod,LastComGrpCod,LastAssGrpCod,"
|
"LastDowGrpCod,LastComGrpCod,LastAssGrpCod,"
|
||||||
"NumAccTst,LastAccTst,NumQstsLastTst,"
|
"NumAccTst,LastAccTst,NumQstsLastTst,"
|
||||||
|
@ -4229,7 +4229,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
|
||||||
|
|
||||||
/***** Remove user from the tables of courses-users *****/
|
/***** Remove user from the tables of courses-users *****/
|
||||||
DB_QueryDELETE ("can not remove a user from a course",
|
DB_QueryDELETE ("can not remove a user from a course",
|
||||||
"DELETE FROM crs_usr_last"
|
"DELETE FROM crs_user_settings"
|
||||||
" WHERE UsrCod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" AND CrsCod=%ld",
|
" AND CrsCod=%ld",
|
||||||
UsrDat->UsrCod,Crs->CrsCod);
|
UsrDat->UsrCod,Crs->CrsCod);
|
||||||
|
|
|
@ -3902,8 +3902,10 @@ static void Brw_UpdateGrpLastAccZone (const char *FieldNameDB,long GrpCod)
|
||||||
{
|
{
|
||||||
/***** Update the group of my last access to a common zone *****/
|
/***** Update the group of my last access to a common zone *****/
|
||||||
DB_QueryUPDATE ("can not update the group of the last access to a file browser",
|
DB_QueryUPDATE ("can not update the group of the last access to a file browser",
|
||||||
"UPDATE crs_usr_last SET %s=%ld"
|
"UPDATE crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" SET %s=%ld"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
FieldNameDB,GrpCod,
|
FieldNameDB,GrpCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
@ -5268,8 +5270,10 @@ static long Brw_GetGrpLastAccZone (const char *FieldNameDB)
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get the group"
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get the group"
|
||||||
" of your last access"
|
" of your last access"
|
||||||
" to a file browser",
|
" to a file browser",
|
||||||
"SELECT %s FROM crs_usr_last"
|
"SELECT %s" // row[0]
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" FROM crs_user_settings"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
FieldNameDB,
|
FieldNameDB,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
|
@ -981,7 +981,7 @@ static void Grp_LockTables (void)
|
||||||
"grp_groups WRITE,"
|
"grp_groups WRITE,"
|
||||||
"grp_users WRITE,"
|
"grp_users WRITE,"
|
||||||
"crs_users READ,"
|
"crs_users READ,"
|
||||||
"crs_usr_last READ,"
|
"crs_user_settings READ,"
|
||||||
"roo_rooms READ");
|
"roo_rooms READ");
|
||||||
Gbl.DB.LockedTables = true;
|
Gbl.DB.LockedTables = true;
|
||||||
}
|
}
|
||||||
|
|
26
swad_test.c
26
swad_test.c
|
@ -603,11 +603,13 @@ static bool Tst_CheckIfNextTstAllowed (void)
|
||||||
"SELECT UNIX_TIMESTAMP(LastAccTst+INTERVAL (NumQstsLastTst*%lu) SECOND)-"
|
"SELECT UNIX_TIMESTAMP(LastAccTst+INTERVAL (NumQstsLastTst*%lu) SECOND)-"
|
||||||
"UNIX_TIMESTAMP()," // row[0]
|
"UNIX_TIMESTAMP()," // row[0]
|
||||||
"UNIX_TIMESTAMP(LastAccTst+INTERVAL (NumQstsLastTst*%lu) SECOND)" // row[1]
|
"UNIX_TIMESTAMP(LastAccTst+INTERVAL (NumQstsLastTst*%lu) SECOND)" // row[1]
|
||||||
" FROM crs_usr_last"
|
" FROM crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
TstCfg_GetConfigMinTimeNxtTstPerQst (),
|
TstCfg_GetConfigMinTimeNxtTstPerQst (),
|
||||||
TstCfg_GetConfigMinTimeNxtTstPerQst (),
|
TstCfg_GetConfigMinTimeNxtTstPerQst (),
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Hierarchy.Crs.CrsCod) == 1)
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
Gbl.Hierarchy.Crs.CrsCod) == 1)
|
||||||
{
|
{
|
||||||
/* Get seconds from now to next access to test */
|
/* Get seconds from now to next access to test */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -657,8 +659,9 @@ static unsigned Tst_GetNumExamsGeneratedByMe (void)
|
||||||
/***** Get number of test exams generated by me from database *****/
|
/***** Get number of test exams generated by me from database *****/
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get number of test exams generated",
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get number of test exams generated",
|
||||||
"SELECT NumAccTst" // row[0]
|
"SELECT NumAccTst" // row[0]
|
||||||
" FROM crs_usr_last"
|
" FROM crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
|
@ -941,8 +944,10 @@ static void Tst_IncreaseMyNumAccessTst (void)
|
||||||
|
|
||||||
/***** Update my number of accesses to test in this course *****/
|
/***** Update my number of accesses to test in this course *****/
|
||||||
DB_QueryUPDATE ("can not update the number of accesses to test",
|
DB_QueryUPDATE ("can not update the number of accesses to test",
|
||||||
"UPDATE crs_usr_last SET NumAccTst=NumAccTst+1"
|
"UPDATE crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" SET NumAccTst=NumAccTst+1"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
}
|
}
|
||||||
|
@ -955,8 +960,11 @@ static void Tst_UpdateLastAccTst (unsigned NumQsts)
|
||||||
{
|
{
|
||||||
/***** Update date-time and number of questions of this test *****/
|
/***** Update date-time and number of questions of this test *****/
|
||||||
DB_QueryUPDATE ("can not update time and number of questions of this test",
|
DB_QueryUPDATE ("can not update time and number of questions of this test",
|
||||||
"UPDATE crs_usr_last SET LastAccTst=NOW(),NumQstsLastTst=%u"
|
"UPDATE crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" SET LastAccTst=NOW(),"
|
||||||
|
"NumQstsLastTst=%u"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
NumQsts,
|
NumQsts,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
36
swad_user.c
36
swad_user.c
|
@ -7752,8 +7752,10 @@ static void Usr_GetMyUsrListTypeFromDB (void)
|
||||||
|
|
||||||
/***** Get type of listing of users from database *****/
|
/***** Get type of listing of users from database *****/
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get type of listing of users",
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get type of listing of users",
|
||||||
"SELECT UsrListType FROM crs_usr_last"
|
"SELECT UsrListType"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" FROM crs_user_settings"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
if (NumRows == 1) // Should be one only row
|
if (NumRows == 1) // Should be one only row
|
||||||
|
@ -7791,8 +7793,10 @@ static void Usr_UpdateMyUsrListTypeInDB (void)
|
||||||
{
|
{
|
||||||
/***** Update type of users listing *****/
|
/***** Update type of users listing *****/
|
||||||
DB_QueryUPDATE ("can not update type of listing",
|
DB_QueryUPDATE ("can not update type of listing",
|
||||||
"UPDATE crs_usr_last SET UsrListType='%s'"
|
"UPDATE crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" SET UsrListType='%s'"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Usr_StringsUsrListTypeInDB[Gbl.Usrs.Me.ListType],
|
Usr_StringsUsrListTypeInDB[Gbl.Usrs.Me.ListType],
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
@ -7857,8 +7861,10 @@ static void Usr_GetMyColsClassPhotoFromDB (void)
|
||||||
/***** Get number of columns in class photo from database *****/
|
/***** Get number of columns in class photo from database *****/
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get number of columns"
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get number of columns"
|
||||||
" in class photo",
|
" in class photo",
|
||||||
"SELECT ColsClassPhoto FROM crs_usr_last"
|
"SELECT ColsClassPhoto"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" FROM crs_user_settings"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
if (NumRows == 1) // Should be one only row
|
if (NumRows == 1) // Should be one only row
|
||||||
|
@ -7891,8 +7897,10 @@ static void Usr_UpdateMyColsClassPhotoInDB (void)
|
||||||
Gbl.Hierarchy.Level == Hie_Lvl_CRS) // Course selected
|
Gbl.Hierarchy.Level == Hie_Lvl_CRS) // Course selected
|
||||||
/***** Update number of colums in class photo for current course *****/
|
/***** Update number of colums in class photo for current course *****/
|
||||||
DB_QueryUPDATE ("can not update number of columns in class photo",
|
DB_QueryUPDATE ("can not update number of columns in class photo",
|
||||||
"UPDATE crs_usr_last SET ColsClassPhoto=%u"
|
"UPDATE crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" SET ColsClassPhoto=%u"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.ClassPhoto.Cols,
|
Gbl.Usrs.ClassPhoto.Cols,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
@ -7962,8 +7970,10 @@ void Usr_GetMyPrefAboutListWithPhotosFromDB (void)
|
||||||
/***** Get if listing of users must show photos from database *****/
|
/***** Get if listing of users must show photos from database *****/
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not check if listing of users"
|
NumRows = DB_QuerySELECT (&mysql_res,"can not check if listing of users"
|
||||||
" must show photos",
|
" must show photos",
|
||||||
"SELECT ListWithPhotos FROM crs_usr_last"
|
"SELECT ListWithPhotos"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" FROM crs_user_settings"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
if (NumRows == 1) // Should be one only row
|
if (NumRows == 1) // Should be one only row
|
||||||
|
@ -7993,8 +8003,10 @@ static void Usr_UpdateMyPrefAboutListWithPhotosPhotoInDB (void)
|
||||||
Gbl.Hierarchy.Level == Hie_Lvl_CRS) // Course selected
|
Gbl.Hierarchy.Level == Hie_Lvl_CRS) // Course selected
|
||||||
/***** Update number of colums in class photo for current course *****/
|
/***** Update number of colums in class photo for current course *****/
|
||||||
DB_QueryUPDATE ("can not update your preference about photos in listing",
|
DB_QueryUPDATE ("can not update your preference about photos in listing",
|
||||||
"UPDATE crs_usr_last SET ListWithPhotos='%c'"
|
"UPDATE crs_user_settings"
|
||||||
" WHERE UsrCod=%ld AND CrsCod=%ld",
|
" SET ListWithPhotos='%c'"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND CrsCod=%ld",
|
||||||
Gbl.Usrs.Listing.WithPhotos ? 'Y' :
|
Gbl.Usrs.Listing.WithPhotos ? 'Y' :
|
||||||
'N',
|
'N',
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
|
Loading…
Reference in New Issue