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.
|
||||
*/
|
||||
#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 JS_FILE "swad20.6.2.js"
|
||||
/*
|
||||
TODO: Rename CENTRE to CENTER in help wiki.
|
||||
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.2: Apr 22, 2021 Clicks-without-photo database table renamed. (309126 lines)
|
||||
1 change necessary in database:
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_database.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_action.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_database.h"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_database.h"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#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\"",
|
||||
(IndicatorsCrs.SyllabusLecSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
||||
"DAT_SMALL_RED",
|
||||
"DAT_SMALL_RED",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusLecSrc]);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
|
||||
(IndicatorsCrs.SyllabusPraSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
|
||||
"DAT_SMALL_RED",
|
||||
"DAT_SMALL_RED",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusPraSrc]);
|
||||
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" :
|
||||
"DAT_SMALL_RED",
|
||||
"DAT_SMALL_RED",
|
||||
Gbl.RowEvenOdd);
|
||||
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
|
||||
HTM_TD_End ();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_database.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.h> // For string functions
|
||||
|
||||
#include "swad_action.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stddef.h> // For NULL
|
||||
#include <stdio.h> // For sscanf, asprintf, etc.
|
||||
#include <stdlib.h> // For free
|
||||
#include <string.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
|
||||
from a notification of received 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
|
||||
else
|
||||
/* Show the last visited page */
|
||||
CurrentPage = Pag_GetLastPageMsgFromSession (Pag_MESSAGES_RECEIVED);
|
||||
break;
|
||||
|
||||
/* Show the last visited page */
|
||||
return Pag_GetLastPageMsgFromSession (Pag_MESSAGES_RECEIVED);
|
||||
case Pag_MESSAGES_SENT:
|
||||
/* Show the last visited page */
|
||||
CurrentPage = Pag_GetLastPageMsgFromSession (Pag_MESSAGES_SENT);
|
||||
break;
|
||||
return Pag_GetLastPageMsgFromSession (Pag_MESSAGES_SENT);
|
||||
default:
|
||||
CurrentPage = 1;
|
||||
break;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return CurrentPage;
|
||||
|
@ -943,25 +940,28 @@ void Pag_SaveLastPageMsgIntoSession (Pag_WhatPaginate_t WhatPaginate,unsigned Nu
|
|||
|
||||
unsigned Pag_GetLastPageMsgFromSession (Pag_WhatPaginate_t WhatPaginate)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
static const char *Field[Pag_NUM_WHAT_PAGINATE] =
|
||||
{
|
||||
[Pag_MESSAGES_RECEIVED] = "LastPageMsgRcv",
|
||||
[Pag_MESSAGES_SENT ] = "LastPageMsgSnt",
|
||||
};
|
||||
unsigned NumPage;
|
||||
|
||||
/***** Get last page of received/sent messages from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get last page of messages",
|
||||
"SELECT %s" // row[0]
|
||||
" FROM ses_sessions"
|
||||
" WHERE SessionId='%s'",
|
||||
WhatPaginate == Pag_MESSAGES_RECEIVED ? "LastPageMsgRcv" :
|
||||
"LastPageMsgSnt",
|
||||
Gbl.Session.Id))
|
||||
Lay_ShowErrorAndExit ("Error when getting last page of messages.");
|
||||
|
||||
/***** Get last page of messages *****/
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
if (sscanf (row[0],"%u",&NumPage) == 1)
|
||||
if (NumPage == 0)
|
||||
NumPage = 1;
|
||||
|
||||
return NumPage;
|
||||
switch (WhatPaginate)
|
||||
{
|
||||
case Pag_MESSAGES_RECEIVED:
|
||||
case Pag_MESSAGES_SENT:
|
||||
/***** Get last page of received/sent messages from database *****/
|
||||
NumPage = DB_QuerySELECTUnsigned ("can not get last page of messages",
|
||||
"SELECT %s"
|
||||
" FROM ses_sessions"
|
||||
" WHERE SessionId='%s'",
|
||||
Field[WhatPaginate],
|
||||
Gbl.Session.Id);
|
||||
if (NumPage == 0)
|
||||
return 1;
|
||||
return NumPage;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#define _GNU_SOURCE // For asprintf
|
||||
#include <linux/limits.h> // For PATH_MAX
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
|
||||
#include "swad_forum.h"
|
||||
#include "swad_global.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#define _GNU_SOURCE // For asprintf
|
||||
#include <stdio.h> // For asprintf
|
||||
#include <stdlib.h> // For free
|
||||
|
||||
#include "swad_action.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_ROW row;
|
||||
unsigned NumCrs;
|
||||
unsigned NumCrss;
|
||||
unsigned NumCrs;
|
||||
long CrsCod;
|
||||
|
||||
/***** 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 *****/
|
||||
DB_Query ("can not create temporary table",
|
||||
"CREATE TEMPORARY TABLE IF NOT EXISTS my_courses_tmp "
|
||||
"(CrsCod INT NOT NULL,"
|
||||
"Role TINYINT NOT NULL,"
|
||||
"DegCod INT NOT NULL,"
|
||||
"UNIQUE INDEX(CrsCod,Role,DegCod)) ENGINE=MEMORY"
|
||||
"CREATE TEMPORARY TABLE IF NOT EXISTS my_courses_tmp"
|
||||
" (CrsCod INT NOT NULL,"
|
||||
"Role TINYINT NOT NULL,"
|
||||
"DegCod INT NOT NULL,"
|
||||
"UNIQUE INDEX(CrsCod,Role,DegCod)) ENGINE=MEMORY"
|
||||
" SELECT crs_users.CrsCod,"
|
||||
"crs_users.Role,"
|
||||
"crs_courses.DegCod"
|
||||
|
@ -1779,7 +1779,8 @@ void Usr_GetMyCourses (void)
|
|||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* 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)
|
||||
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 *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
}
|
||||
|
||||
/***** Set boolean that indicates that my courses are yet filled *****/
|
||||
Gbl.Usrs.Me.MyCrss.Filled = true;
|
||||
/***** Set boolean that indicates that my courses are already filled *****/
|
||||
Gbl.Usrs.Me.MyCrss.Filled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue