mirror of https://github.com/acanas/swad-core.git
Version 20.66.5: Apr 23, 2021 Including missing head files.
This commit is contained in:
parent
9c905259a2
commit
9343280967
|
@ -600,13 +600,16 @@ 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.66.3 (2021-04-23)"
|
#define Log_PLATFORM_VERSION "SWAD 20.66.5 (2021-04-23)"
|
||||||
#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.66.5: Apr 23, 2021 Including missing head files.
|
||||||
|
Fixed bug getting my courses. (309123 lines)
|
||||||
|
Version 20.66.4: Apr 23, 2021 Fixed bug in pagination of messages. (309110 lines)
|
||||||
Version 20.66.3: Apr 23, 2021 Fixed bug in course information. (309108 lines)
|
Version 20.66.3: Apr 23, 2021 Fixed bug in course information. (309108 lines)
|
||||||
Version 20.66.2: Apr 22, 2021 Clicks-without-photo database table renamed. (309126 lines)
|
Version 20.66.2: Apr 22, 2021 Clicks-without-photo database table renamed. (309126 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_action.h"
|
#include "swad_action.h"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
|
|
@ -1191,21 +1191,21 @@ static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *I
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
|
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
|
||||||
(IndicatorsCrs.SyllabusLecSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
(IndicatorsCrs.SyllabusLecSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
||||||
"DAT_SMALL_RED",
|
"DAT_SMALL_RED",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusLecSrc]);
|
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusLecSrc]);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
|
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
|
||||||
(IndicatorsCrs.SyllabusPraSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
(IndicatorsCrs.SyllabusPraSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
||||||
"DAT_SMALL_RED",
|
"DAT_SMALL_RED",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusPraSrc]);
|
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusPraSrc]);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s LM COLOR%u\">",
|
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
|
||||||
(IndicatorsCrs.TeachingGuideSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
(IndicatorsCrs.TeachingGuideSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
||||||
"DAT_SMALL_RED",
|
"DAT_SMALL_RED",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
|
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_action.h"
|
#include "swad_action.h"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stddef.h> // For NULL
|
#include <stddef.h> // For NULL
|
||||||
#include <stdio.h> // For sscanf, asprintf, etc.
|
#include <stdio.h> // For sscanf, asprintf, etc.
|
||||||
|
#include <stdlib.h> // For free
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "swad_box.h"
|
#include "swad_box.h"
|
||||||
|
|
|
@ -903,19 +903,16 @@ unsigned Pag_GetParamPagNum (Pag_WhatPaginate_t WhatPaginate)
|
||||||
/* Expanding a message, perhaps it is the result of following a link
|
/* Expanding a message, perhaps it is the result of following a link
|
||||||
from a notification of received message */
|
from a notification of received message */
|
||||||
/* Show the page corresponding to the expanded message */
|
/* Show the page corresponding to the expanded message */
|
||||||
CurrentPage = 1; // Now set the current page to the first,
|
return 1; // Now set the current page to the first,
|
||||||
// but later the correct page will be calculated
|
// but later the correct page will be calculated
|
||||||
else
|
|
||||||
/* Show the last visited page */
|
/* Show the last visited page */
|
||||||
CurrentPage = Pag_GetLastPageMsgFromSession (Pag_MESSAGES_RECEIVED);
|
return Pag_GetLastPageMsgFromSession (Pag_MESSAGES_RECEIVED);
|
||||||
break;
|
|
||||||
case Pag_MESSAGES_SENT:
|
case Pag_MESSAGES_SENT:
|
||||||
/* Show the last visited page */
|
/* Show the last visited page */
|
||||||
CurrentPage = Pag_GetLastPageMsgFromSession (Pag_MESSAGES_SENT);
|
return Pag_GetLastPageMsgFromSession (Pag_MESSAGES_SENT);
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
CurrentPage = 1;
|
return 1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CurrentPage;
|
return CurrentPage;
|
||||||
|
@ -943,25 +940,28 @@ void Pag_SaveLastPageMsgIntoSession (Pag_WhatPaginate_t WhatPaginate,unsigned Nu
|
||||||
|
|
||||||
unsigned Pag_GetLastPageMsgFromSession (Pag_WhatPaginate_t WhatPaginate)
|
unsigned Pag_GetLastPageMsgFromSession (Pag_WhatPaginate_t WhatPaginate)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
static const char *Field[Pag_NUM_WHAT_PAGINATE] =
|
||||||
MYSQL_ROW row;
|
{
|
||||||
|
[Pag_MESSAGES_RECEIVED] = "LastPageMsgRcv",
|
||||||
|
[Pag_MESSAGES_SENT ] = "LastPageMsgSnt",
|
||||||
|
};
|
||||||
unsigned NumPage;
|
unsigned NumPage;
|
||||||
|
|
||||||
/***** Get last page of received/sent messages from database *****/
|
switch (WhatPaginate)
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get last page of messages",
|
{
|
||||||
"SELECT %s" // row[0]
|
case Pag_MESSAGES_RECEIVED:
|
||||||
" FROM ses_sessions"
|
case Pag_MESSAGES_SENT:
|
||||||
" WHERE SessionId='%s'",
|
/***** Get last page of received/sent messages from database *****/
|
||||||
WhatPaginate == Pag_MESSAGES_RECEIVED ? "LastPageMsgRcv" :
|
NumPage = DB_QuerySELECTUnsigned ("can not get last page of messages",
|
||||||
"LastPageMsgSnt",
|
"SELECT %s"
|
||||||
Gbl.Session.Id))
|
" FROM ses_sessions"
|
||||||
Lay_ShowErrorAndExit ("Error when getting last page of messages.");
|
" WHERE SessionId='%s'",
|
||||||
|
Field[WhatPaginate],
|
||||||
/***** Get last page of messages *****/
|
Gbl.Session.Id);
|
||||||
row = mysql_fetch_row (mysql_res);
|
if (NumPage == 0)
|
||||||
if (sscanf (row[0],"%u",&NumPage) == 1)
|
return 1;
|
||||||
if (NumPage == 0)
|
return NumPage;
|
||||||
NumPage = 1;
|
default:
|
||||||
|
return 1;
|
||||||
return NumPage;
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#define _GNU_SOURCE // For asprintf
|
#define _GNU_SOURCE // For asprintf
|
||||||
#include <linux/limits.h> // For PATH_MAX
|
#include <linux/limits.h> // For PATH_MAX
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
|
|
||||||
#include "swad_forum.h"
|
#include "swad_forum.h"
|
||||||
#include "swad_global.h"
|
#include "swad_global.h"
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#define _GNU_SOURCE // For asprintf
|
#define _GNU_SOURCE // For asprintf
|
||||||
#include <stdio.h> // For asprintf
|
#include <stdio.h> // For asprintf
|
||||||
|
#include <stdlib.h> // For free
|
||||||
|
|
||||||
#include "swad_action.h"
|
#include "swad_action.h"
|
||||||
#include "swad_global.h"
|
#include "swad_global.h"
|
||||||
|
|
21
swad_user.c
21
swad_user.c
|
@ -1730,8 +1730,8 @@ void Usr_GetMyCourses (void)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned NumCrs;
|
|
||||||
unsigned NumCrss;
|
unsigned NumCrss;
|
||||||
|
unsigned NumCrs;
|
||||||
long CrsCod;
|
long CrsCod;
|
||||||
|
|
||||||
/***** If my courses are yet filled, there's nothing to do *****/
|
/***** If my courses are yet filled, there's nothing to do *****/
|
||||||
|
@ -1746,11 +1746,11 @@ void Usr_GetMyCourses (void)
|
||||||
|
|
||||||
/***** Create temporary table with my courses *****/
|
/***** Create temporary table with my courses *****/
|
||||||
DB_Query ("can not create temporary table",
|
DB_Query ("can not create temporary table",
|
||||||
"CREATE TEMPORARY TABLE IF NOT EXISTS my_courses_tmp "
|
"CREATE TEMPORARY TABLE IF NOT EXISTS my_courses_tmp"
|
||||||
"(CrsCod INT NOT NULL,"
|
" (CrsCod INT NOT NULL,"
|
||||||
"Role TINYINT NOT NULL,"
|
"Role TINYINT NOT NULL,"
|
||||||
"DegCod INT NOT NULL,"
|
"DegCod INT NOT NULL,"
|
||||||
"UNIQUE INDEX(CrsCod,Role,DegCod)) ENGINE=MEMORY"
|
"UNIQUE INDEX(CrsCod,Role,DegCod)) ENGINE=MEMORY"
|
||||||
" SELECT crs_users.CrsCod,"
|
" SELECT crs_users.CrsCod,"
|
||||||
"crs_users.Role,"
|
"crs_users.Role,"
|
||||||
"crs_courses.DegCod"
|
"crs_courses.DegCod"
|
||||||
|
@ -1779,7 +1779,8 @@ void Usr_GetMyCourses (void)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get course code */
|
/* Get course code */
|
||||||
if ((CrsCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
|
CrsCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
if (CrsCod > 0)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Me.MyCrss.Num == Crs_MAX_COURSES_PER_USR)
|
if (Gbl.Usrs.Me.MyCrss.Num == Crs_MAX_COURSES_PER_USR)
|
||||||
Lay_ShowErrorAndExit ("Maximum number of courses of a user exceeded.");
|
Lay_ShowErrorAndExit ("Maximum number of courses of a user exceeded.");
|
||||||
|
@ -1793,10 +1794,10 @@ void Usr_GetMyCourses (void)
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
}
|
|
||||||
|
|
||||||
/***** Set boolean that indicates that my courses are yet filled *****/
|
/***** Set boolean that indicates that my courses are already filled *****/
|
||||||
Gbl.Usrs.Me.MyCrss.Filled = true;
|
Gbl.Usrs.Me.MyCrss.Filled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue