Version 14.70.1

This commit is contained in:
Antonio Cañas Vargas 2015-01-27 20:50:44 +01:00
parent bf1af71937
commit 3087cdd85b
6 changed files with 31 additions and 25 deletions

View File

@ -39,11 +39,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.70 (2015/01/26)"
#define Log_PLATFORM_VERSION "SWAD 14.70.1 (2015/01/27)"
// 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 | tail -1
/*
Version 14.70.1: Jan 27, 2015 Fixed bug when removing a user from a course. (176187 lines)
Version 14.70: Jan 26, 2015 Fixed bugs in statistics about sizes of file browsers.
Statistics about sizes of group zones.
New scope (country) in statistics about sizes of file browsers. (176181 lines)

View File

@ -28,8 +28,8 @@
/** Uncomment one of the following installations of SWAD or create your own **/
/*****************************************************************************/
#define LOCALHOST_UBUNTU // Comment this line if not applicable
//#define OPENSWAD_ORG // Comment this line if not applicable
//#define LOCALHOST_UBUNTU // Comment this line if not applicable
#define OPENSWAD_ORG // Comment this line if not applicable
//#define SWAD_UGR_ES // Comment this line if not applicable
//#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable

View File

@ -993,15 +993,14 @@ mysql> DESCRIBE file_browser_size;
| Field | Type | Null | Key | Default | Extra |
+-------------+------------+------+-----+---------+-------+
| FileBrowser | tinyint(4) | NO | PRI | NULL | |
| CrsCod | int(11) | NO | PRI | -1 | |
| GrpCod | int(11) | NO | PRI | -1 | |
| UsrCod | int(11) | NO | PRI | -1 | |
| Cod | int(11) | NO | PRI | -1 | |
| ZoneUsrCod | int(11) | NO | PRI | -1 | |
| NumLevels | int(11) | NO | | NULL | |
| NumFolders | int(11) | NO | | NULL | |
| NumFiles | int(11) | NO | | NULL | |
| TotalSize | bigint(20) | NO | | NULL | |
+-------------+------------+------+-----+---------+-------+
8 rows in set (0.00 sec)
7 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_browser_size ("
"FileBrowser TINYINT NOT NULL,"

View File

@ -3843,7 +3843,10 @@ void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long CrsCod,long UsrCod)
" AND Cod='%ld')"
" OR "
"(FileBrowser IN ('%u','%u','%u')"
" AND Cod IN (SELECT GrpCod FROM crs_grp WHERE CrsCod='%ld'))"
" AND Cod IN"
" (SELECT crs_grp.GrpCod FROM crs_grp_types,crs_grp"
" WHERE crs_grp_types.CrsCod='%ld'"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod))"
")",
UsrCod,
(unsigned) Brw_ADMI_DOCUM_CRS,
@ -3867,7 +3870,10 @@ void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long CrsCod,long UsrCod)
" AND Cod='%ld')"
" OR "
"(FileBrowser IN ('%u','%u','%u')"
" AND Cod IN (SELECT GrpCod FROM crs_grp WHERE CrsCod='%ld'))"
" AND Cod IN"
" (SELECT crs_grp.GrpCod FROM crs_grp_types,crs_grp"
" WHERE crs_grp_types.CrsCod='%ld'"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod))"
")",
UsrCod,
(unsigned) Brw_ADMI_DOCUM_CRS,
@ -3893,7 +3899,10 @@ void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long CrsCod,long UsrCod)
" AND Cod='%ld')"
" OR "
"(FileBrowser IN ('%u','%u','%u')"
" AND Cod IN (SELECT GrpCod FROM crs_grp WHERE CrsCod='%ld'))"
" AND Cod IN"
" (SELECT crs_grp.GrpCod FROM crs_grp_types,crs_grp"
" WHERE crs_grp_types.CrsCod='%ld'"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod))"
")",
UsrCod,
(unsigned) Brw_ADMI_DOCUM_CRS,
@ -3944,16 +3953,6 @@ void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod)
CrsCod,UsrCod);
DB_QueryDELETE (Query,"can not remove clipboards");
/***** Remove from database the entries that store the last time users visited file zones *****/
// Assignments and works are stored as one in file_browser_last...
// ...because a user views them at the same time
sprintf (Query,"DELETE FROM file_browser_last"
" WHERE FileBrowser='%u'"
" AND Cod='%ld' AND ZoneUsrCod='%ld'",
(unsigned) Brw_ADMI_ASSIG_USR,
CrsCod,UsrCod);
DB_QueryDELETE (Query,"can not remove file last visits");
/***** Remove from database the entries that store the sizes of the file zones *****/
sprintf (Query,"DELETE FROM file_browser_size"
" WHERE FileBrowser IN ('%u','%u')"

View File

@ -2548,7 +2548,10 @@ unsigned long Grp_GetGrpsOfType (long GrpTypCod,MYSQL_RES **mysql_res)
/***** Get groups of a type from database *****/
sprintf (Query,"SELECT GrpCod,GrpName,MaxStudents,Open,FileZones"
" FROM crs_grp WHERE GrpTypCod='%ld' ORDER BY GrpName",GrpTypCod);
" FROM crs_grp"
" WHERE GrpTypCod='%ld'"
" ORDER BY GrpName",
GrpTypCod);
return DB_QuerySELECT (Query,mysql_res,"can not get groups of a type");
}
@ -2911,7 +2914,8 @@ static void Grp_GetLstCodGrpsUsrBelongs (long CrsCod,long GrpTypCod,
/***** Get groups which a user belong to from database *****/
if (CrsCod < 0) // Query the groups from all the user's courses
sprintf (Query,"SELECT GrpCod FROM crs_grp_usr"
" WHERE UsrCod='%ld'",UsrCod); // Groups will be unordered
" WHERE UsrCod='%ld'", // Groups will be unordered
UsrCod);
else if (GrpTypCod < 0) // Query the groups of any type in the course
sprintf (Query,"SELECT crs_grp.GrpCod FROM crs_grp_types,crs_grp,crs_grp_usr"
" WHERE crs_grp_types.CrsCod='%ld' AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
@ -3399,7 +3403,8 @@ static void Grp_RemoveGroupTypeCompletely (void)
/***** Change all groups of this type in course timetable *****/
sprintf (Query,"UPDATE timetable_crs SET GrpCod='-1'"
" WHERE GrpCod IN (SELECT GrpCod FROM crs_grp WHERE GrpTypCod='%ld')",
" WHERE GrpCod IN"
" (SELECT GrpCod FROM crs_grp WHERE GrpTypCod='%ld')",
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod);
DB_QueryUPDATE (Query,"can not update all groups of a type in course timetable");

View File

@ -501,8 +501,10 @@ static unsigned Imp_GetAndListImpGrpsAndStdsFromDB (bool ItsAFormToRegRemStds)
unsigned NumStds,NumStd;
/***** Get data of imported groups from database *****/
sprintf (Query,"SELECT GrpCod,ExternalCrsCod,DegName,CrsName,GrpName,GrpType FROM imported_groups"
" WHERE SessionId='%s' ORDER BY DegName,CrsName,GrpName,GrpType",
sprintf (Query,"SELECT GrpCod,ExternalCrsCod,DegName,CrsName,GrpName,GrpType"
" FROM imported_groups"
" WHERE SessionId='%s'"
" ORDER BY DegName,CrsName,GrpName,GrpType",
Gbl.Session.Id);
NumGrps = (unsigned) DB_QuerySELECT (Query,&mysql_res_grp,"can not get imported groups");