mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-07 01:05:39 +02:00
Version 16.155.7
This commit is contained in:
parent
2570a8cc4c
commit
f9f6e9fe05
|
@ -392,7 +392,7 @@ CREATE TABLE IF NOT EXISTS debug (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS deg_types (
|
CREATE TABLE IF NOT EXISTS deg_types (
|
||||||
DegTypCod INT NOT NULL AUTO_INCREMENT,
|
DegTypCod INT NOT NULL AUTO_INCREMENT,
|
||||||
DegTypName VARCHAR(32) NOT NULL,
|
DegTypName VARCHAR(511) NOT NULL,
|
||||||
UNIQUE INDEX(DegTypCod));
|
UNIQUE INDEX(DegTypCod));
|
||||||
--
|
--
|
||||||
-- Table degrees: stores the degrees
|
-- Table degrees: stores the degrees
|
||||||
|
|
|
@ -207,13 +207,17 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.155.6 (2017-03-11)"
|
#define Log_PLATFORM_VERSION "SWAD 16.155.7 (2017-03-11)"
|
||||||
#define CSS_FILE "swad16.147.css"
|
#define CSS_FILE "swad16.147.css"
|
||||||
#define JS_FILE "swad16.144.js"
|
#define JS_FILE "swad16.144.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 16.155.7: Mar 11, 2017 Adjusting size of database fields. (216682 lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
ALTER TABLE deg_types CHANGE COLUMN DegTypName DegTypName VARCHAR(511) NOT NULL;
|
||||||
|
|
||||||
Version 16.155.6: Mar 11, 2017 Adjusting size of database fields. (216677 lines)
|
Version 16.155.6: Mar 11, 2017 Adjusting size of database fields. (216677 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
ALTER TABLE crs_record_fields CHANGE COLUMN FieldName FieldName VARCHAR(2047) NOT NULL;
|
ALTER TABLE crs_record_fields CHANGE COLUMN FieldName FieldName VARCHAR(2047) NOT NULL;
|
||||||
|
|
|
@ -798,10 +798,10 @@ mysql> DESCRIBE crs_records;
|
||||||
3 rows in set (0.00 sec)
|
3 rows in set (0.00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_records ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_records ("
|
||||||
"FieldCod INT NOT NULL,"
|
"FieldCod INT NOT NULL,"
|
||||||
"UsrCod INT NOT NULL,"
|
"UsrCod INT NOT NULL,"
|
||||||
"Txt TEXT NOT NULL,"
|
"Txt TEXT NOT NULL," // Cns_MAX_BYTES_TEXT
|
||||||
"UNIQUE INDEX(FieldCod,UsrCod))");
|
"UNIQUE INDEX(FieldCod,UsrCod))");
|
||||||
|
|
||||||
/***** Table crs_usr *****/
|
/***** Table crs_usr *****/
|
||||||
/*
|
/*
|
||||||
|
@ -826,23 +826,23 @@ mysql> DESCRIBE crs_usr;
|
||||||
13 rows in set (0.00 sec)
|
13 rows in set (0.00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_usr ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_usr ("
|
||||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||||
"UsrCod INT NOT NULL,"
|
"UsrCod INT NOT NULL,"
|
||||||
"Role TINYINT NOT NULL DEFAULT 0,"
|
"Role TINYINT NOT NULL DEFAULT 0,"
|
||||||
"Accepted ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
"Accepted ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||||
"LastDowGrpCod INT NOT NULL DEFAULT -1,"
|
"LastDowGrpCod INT NOT NULL DEFAULT -1,"
|
||||||
"LastComGrpCod INT NOT NULL DEFAULT -1,"
|
"LastComGrpCod INT NOT NULL DEFAULT -1,"
|
||||||
"LastAssGrpCod INT NOT NULL DEFAULT -1,"
|
"LastAssGrpCod INT NOT NULL DEFAULT -1,"
|
||||||
"NumAccTst INT NOT NULL DEFAULT 0,"
|
"NumAccTst INT NOT NULL DEFAULT 0,"
|
||||||
"LastAccTst DATETIME NOT NULL,"
|
"LastAccTst DATETIME NOT NULL,"
|
||||||
"NumQstsLastTst INT NOT NULL DEFAULT 0,"
|
"NumQstsLastTst INT NOT NULL DEFAULT 0,"
|
||||||
"UsrListType ENUM('classphoto','list') NOT NULL DEFAULT 'classphoto',"
|
"UsrListType ENUM('classphoto','list') NOT NULL DEFAULT 'classphoto',"
|
||||||
"ColsClassPhoto TINYINT NOT NULL,"
|
"ColsClassPhoto TINYINT NOT NULL,"
|
||||||
"ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',"
|
"ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',"
|
||||||
"UNIQUE INDEX(CrsCod,UsrCod,Role),"
|
"UNIQUE INDEX(CrsCod,UsrCod,Role),"
|
||||||
"UNIQUE INDEX(UsrCod,CrsCod,Role),"
|
"UNIQUE INDEX(UsrCod,CrsCod,Role),"
|
||||||
"INDEX(CrsCod,Role),"
|
"INDEX(CrsCod,Role),"
|
||||||
"INDEX(UsrCod,Role))");
|
"INDEX(UsrCod,Role))");
|
||||||
|
|
||||||
/***** Table crs_usr_requests *****/
|
/***** Table crs_usr_requests *****/
|
||||||
/*
|
/*
|
||||||
|
@ -859,30 +859,30 @@ mysql> DESCRIBE crs_usr_requests;
|
||||||
5 rows in set (0.01 sec)
|
5 rows in set (0.01 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_usr_requests ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_usr_requests ("
|
||||||
"ReqCod INT NOT NULL AUTO_INCREMENT,"
|
"ReqCod INT NOT NULL AUTO_INCREMENT,"
|
||||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||||
"UsrCod INT NOT NULL,"
|
"UsrCod INT NOT NULL,"
|
||||||
"Role TINYINT NOT NULL DEFAULT 0,"
|
"Role TINYINT NOT NULL DEFAULT 0,"
|
||||||
"RequestTime DATETIME NOT NULL,"
|
"RequestTime DATETIME NOT NULL,"
|
||||||
"UNIQUE INDEX(ReqCod),"
|
"UNIQUE INDEX(ReqCod),"
|
||||||
"UNIQUE INDEX(CrsCod,UsrCod),"
|
"UNIQUE INDEX(CrsCod,UsrCod),"
|
||||||
"INDEX(UsrCod))");
|
"INDEX(UsrCod))");
|
||||||
|
|
||||||
/***** Table deg_types *****/
|
/***** Table deg_types *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE deg_types;
|
mysql> DESCRIBE deg_types;
|
||||||
+------------+-------------+------+-----+---------+----------------+
|
+------------+--------------+------+-----+---------+----------------+
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
+------------+-------------+------+-----+---------+----------------+
|
+------------+--------------+------+-----+---------+----------------+
|
||||||
| DegTypCod | int(11) | NO | PRI | NULL | auto_increment |
|
| DegTypCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||||
| DegTypName | varchar(32) | NO | | NULL | |
|
| DegTypName | varchar(511) | NO | | NULL | |
|
||||||
+------------+-------------+------+-----+---------+----------------+
|
+------------+--------------+------+-----+---------+----------------+
|
||||||
2 rows in set (0.00 sec)
|
2 rows in set (0,00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS deg_types ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS deg_types ("
|
||||||
"DegTypCod INT NOT NULL AUTO_INCREMENT,"
|
"DegTypCod INT NOT NULL AUTO_INCREMENT,"
|
||||||
"DegTypName VARCHAR(32) NOT NULL,"
|
"DegTypName VARCHAR(511) NOT NULL," // Deg_MAX_BYTES_DEGREE_TYPE_NAME
|
||||||
"UNIQUE INDEX(DegTypCod))");
|
"UNIQUE INDEX(DegTypCod))");
|
||||||
|
|
||||||
/***** Table degrees *****/
|
/***** Table degrees *****/
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -453,11 +453,13 @@ void DT_GetListDegreeTypes (void)
|
||||||
/***** Get types of degree from database *****/
|
/***** Get types of degree from database *****/
|
||||||
sprintf (Query,"(SELECT deg_types.DegTypCod,deg_types.DegTypName AS DegTypName,"
|
sprintf (Query,"(SELECT deg_types.DegTypCod,deg_types.DegTypName AS DegTypName,"
|
||||||
" COUNT(degrees.DegCod)"
|
" COUNT(degrees.DegCod)"
|
||||||
" FROM deg_types,degrees WHERE deg_types.DegTypCod=degrees.DegTypCod"
|
" FROM deg_types,degrees"
|
||||||
|
" WHERE deg_types.DegTypCod=degrees.DegTypCod"
|
||||||
" GROUP BY degrees.DegTypCod)"
|
" GROUP BY degrees.DegTypCod)"
|
||||||
" UNION "
|
" UNION "
|
||||||
"(SELECT DegTypCod,DegTypName,'0'"
|
"(SELECT DegTypCod,DegTypName,'0'"
|
||||||
" FROM deg_types WHERE DegTypCod NOT IN (SELECT DegTypCod FROM degrees))"
|
" FROM deg_types"
|
||||||
|
" WHERE DegTypCod NOT IN (SELECT DegTypCod FROM degrees))"
|
||||||
" ORDER BY DegTypName");
|
" ORDER BY DegTypName");
|
||||||
Gbl.Degs.DegTypes.Num = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get types of degree");
|
Gbl.Degs.DegTypes.Num = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get types of degree");
|
||||||
|
|
||||||
|
@ -608,7 +610,7 @@ long DT_GetParamOtherDegTypCod (void)
|
||||||
|
|
||||||
static unsigned DT_CountNumDegsOfType (long DegTypCod)
|
static unsigned DT_CountNumDegsOfType (long DegTypCod)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[128];
|
||||||
|
|
||||||
/***** Get number of degrees of a type from database *****/
|
/***** Get number of degrees of a type from database *****/
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM degrees WHERE DegTypCod='%ld'",
|
sprintf (Query,"SELECT COUNT(*) FROM degrees WHERE DegTypCod='%ld'",
|
||||||
|
@ -622,7 +624,7 @@ static unsigned DT_CountNumDegsOfType (long DegTypCod)
|
||||||
|
|
||||||
bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp)
|
bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[128];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
|
@ -678,7 +680,7 @@ bool DT_GetDataOfDegreeTypeByCod (struct DegreeType *DegTyp)
|
||||||
|
|
||||||
static void DT_RemoveDegreeTypeCompletely (long DegTypCod)
|
static void DT_RemoveDegreeTypeCompletely (long DegTypCod)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[128];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned long NumRow,NumRows;
|
unsigned long NumRow,NumRows;
|
||||||
|
@ -724,7 +726,7 @@ void DT_RenameDegreeType (void)
|
||||||
extern const char *Txt_The_type_of_degree_X_has_been_renamed_as_Y;
|
extern const char *Txt_The_type_of_degree_X_has_been_renamed_as_Y;
|
||||||
extern const char *Txt_The_name_of_the_type_of_degree_X_has_not_changed;
|
extern const char *Txt_The_name_of_the_type_of_degree_X_has_not_changed;
|
||||||
struct DegreeType *DegTyp;
|
struct DegreeType *DegTyp;
|
||||||
char Query[1024];
|
char Query[128 + Deg_MAX_BYTES_DEGREE_TYPE_NAME];
|
||||||
char NewNameDegTyp[Deg_MAX_BYTES_DEGREE_TYPE_NAME + 1];
|
char NewNameDegTyp[Deg_MAX_BYTES_DEGREE_TYPE_NAME + 1];
|
||||||
|
|
||||||
DegTyp = &Gbl.Degs.EditingDegTyp;
|
DegTyp = &Gbl.Degs.EditingDegTyp;
|
||||||
|
@ -794,7 +796,7 @@ void DT_RenameDegreeType (void)
|
||||||
|
|
||||||
static bool DT_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod)
|
static bool DT_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[256 + Deg_MAX_BYTES_DEGREE_TYPE_NAME];
|
||||||
|
|
||||||
/***** Get number of degree types with a name from database *****/
|
/***** Get number of degree types with a name from database *****/
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM deg_types"
|
sprintf (Query,"SELECT COUNT(*) FROM deg_types"
|
||||||
|
@ -812,7 +814,7 @@ void DT_ChangeDegreeType (void)
|
||||||
extern const char *Txt_The_type_of_degree_of_the_degree_X_has_changed;
|
extern const char *Txt_The_type_of_degree_of_the_degree_X_has_changed;
|
||||||
struct Degree *Deg;
|
struct Degree *Deg;
|
||||||
long NewDegTypCod;
|
long NewDegTypCod;
|
||||||
char Query[512];
|
char Query[128];
|
||||||
|
|
||||||
Deg = &Gbl.Degs.EditingDeg;
|
Deg = &Gbl.Degs.EditingDeg;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user