mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-08 09:45:26 +02:00
Version 16.148
This commit is contained in:
parent
a47496b456
commit
3f1dd125fb
|
@ -830,8 +830,9 @@ static void Asg_GetAssignmentTxtFromDB (long AsgCod,char Txt[Cns_MAX_BYTES_TEXT
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service
|
// This function may be called inside a web service
|
||||||
|
|
||||||
void Asg_GetNotifAssignment (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **ContentStr,
|
void Asg_GetNotifAssignment (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long AsgCod,unsigned MaxChars,bool GetContent)
|
char **ContentStr,
|
||||||
|
long AsgCod,bool GetContent)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -854,9 +855,7 @@ void Asg_GetNotifAssignment (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **Cont
|
||||||
|
|
||||||
/***** Get summary *****/
|
/***** Get summary *****/
|
||||||
Str_Copy (SummaryStr,row[0],
|
Str_Copy (SummaryStr,row[0],
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
if (MaxChars)
|
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
|
||||||
|
|
||||||
/***** Get content *****/
|
/***** Get content *****/
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
|
|
|
@ -75,8 +75,9 @@ void Asg_GetDataOfAssignmentByCod (struct Assignment *Asg);
|
||||||
void Asg_GetDataOfAssignmentByFolder (struct Assignment *Asg);
|
void Asg_GetDataOfAssignmentByFolder (struct Assignment *Asg);
|
||||||
void Asg_FreeListAssignments (void);
|
void Asg_FreeListAssignments (void);
|
||||||
|
|
||||||
void Asg_GetNotifAssignment (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **ContentStr,
|
void Asg_GetNotifAssignment (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long AsgCod,unsigned MaxChars,bool GetContent);
|
char **ContentStr,
|
||||||
|
long AsgCod,bool GetContent);
|
||||||
|
|
||||||
long Asg_GetParamAsgCod (void);
|
long Asg_GetParamAsgCod (void);
|
||||||
void Asg_ReqRemAssignment (void);
|
void Asg_ReqRemAssignment (void);
|
||||||
|
|
|
@ -193,17 +193,23 @@
|
||||||
// TODO: System admin should view link "Visits to course"
|
// TODO: System admin should view link "Visits to course"
|
||||||
// TODO: Un administrador de institución, ¿debería poder cambiar la contraseña de un usuario de esa institución? No lo tengo claro.
|
// TODO: Un administrador de institución, ¿debería poder cambiar la contraseña de un usuario de esa institución? No lo tengo claro.
|
||||||
|
|
||||||
|
// TODO: Subject in forum_post should be VARCHAR(255) in order to be copied directly to SummaryStr
|
||||||
|
// TODO: Add a Subject (VARCHAR(255)) to notices to be used as SummaryStr
|
||||||
|
// TODO: Subject in msg_content and msg_content_deleted should be VARCHAR(255) in order to be copied directly to SummaryStr
|
||||||
|
// TODO: Check how to get a summary of a social post or comments
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.147.11 (2017-03-06)"
|
#define Log_PLATFORM_VERSION "SWAD 16.148 (2017-03-06)"
|
||||||
#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.148: Mar 06, 2017 Code refactoring in notifications. (216393 lines)
|
||||||
Version 16.147.11:Mar 06, 2017 Changes in names of zipped files. (216388 lines)
|
Version 16.147.11:Mar 06, 2017 Changes in names of zipped files. (216388 lines)
|
||||||
Version 16.147.10:Mar 06, 2017 Changes in layout of users' listing. (216394 lines)
|
Version 16.147.10:Mar 06, 2017 Changes in layout of users' listing. (216394 lines)
|
||||||
Version 16.147.9: Mar 06, 2017 Changes in layout of header. (216389 lines)
|
Version 16.147.9: Mar 06, 2017 Changes in layout of header. (216389 lines)
|
||||||
|
|
|
@ -268,10 +268,6 @@
|
||||||
/* Courses */
|
/* Courses */
|
||||||
#define Cfg_MIN_NUM_COURSES_TO_CONFIRM_SHOW_BIG_LIST 500 // If the number of courses in a list is greater than this, ask me for confirmation before showing the list
|
#define Cfg_MIN_NUM_COURSES_TO_CONFIRM_SHOW_BIG_LIST 500 // If the number of courses in a list is greater than this, ask me for confirmation before showing the list
|
||||||
|
|
||||||
/* Notifications */
|
|
||||||
#define Cfg_MAX_CHARS_NOTIF_SUMMARY_SWAD 50
|
|
||||||
#define Cfg_MAX_CHARS_NOTIF_SUMMARY_WEB_SERVICE 100
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Directories, folder and files ***********************/
|
/*********************** Directories, folder and files ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
#define Cns_MAX_LENGTH_SUBJECT (256 - 1)
|
#define Cns_MAX_LENGTH_SUBJECT (256 - 1)
|
||||||
#define Cns_MAX_BYTES_SUBJECT (Cns_MAX_LENGTH_SUBJECT * Str_MAX_CHARACTER)
|
#define Cns_MAX_BYTES_SUBJECT (Cns_MAX_LENGTH_SUBJECT * Str_MAX_CHARACTER)
|
||||||
|
|
||||||
|
#define Cns_MAX_BYTES_SUMMARY_STRING (256 - 1)
|
||||||
|
|
||||||
#define Cns_MAX_BYTES_TEXT ( 64 * 1024 - 1) // Used for subjects and other medium texts
|
#define Cns_MAX_BYTES_TEXT ( 64 * 1024 - 1) // Used for subjects and other medium texts
|
||||||
#define Cns_MAX_BYTES_LONG_TEXT (256 * 1024 - 1) // Used for big contents
|
#define Cns_MAX_BYTES_LONG_TEXT (256 * 1024 - 1) // Used for big contents
|
||||||
|
|
||||||
|
|
|
@ -385,9 +385,8 @@ void Enr_ReqAcceptRegisterInCrs (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Enr_GetNotifEnrollment (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Enr_GetNotifEnrollment (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long CrsCod,long UsrCod,
|
long CrsCod,long UsrCod)
|
||||||
unsigned MaxChars)
|
|
||||||
{
|
{
|
||||||
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||||
char Query[256];
|
char Query[256];
|
||||||
|
@ -423,9 +422,7 @@ void Enr_GetNotifEnrollment (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
/* Role (row[0]) */
|
/* Role (row[0]) */
|
||||||
Role = Rol_ConvertUnsignedStrToRole (row[0]);
|
Role = Rol_ConvertUnsignedStrToRole (row[0]);
|
||||||
Str_Copy (SummaryStr,Txt_ROLES_SINGUL_Abc[Role][UsrDat.Sex],
|
Str_Copy (SummaryStr,Txt_ROLES_SINGUL_Abc[Role][UsrDat.Sex],
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
if (MaxChars)
|
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
|
||||||
|
|
||||||
/* Free memory used for user's data */
|
/* Free memory used for user's data */
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
@ -1948,8 +1945,9 @@ void Enr_SignUpInCrs (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Enr_GetNotifEnrollmentRequest (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **ContentStr,
|
void Enr_GetNotifEnrollmentRequest (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long ReqCod,unsigned MaxChars,bool GetContent)
|
char **ContentStr,
|
||||||
|
long ReqCod,bool GetContent)
|
||||||
{
|
{
|
||||||
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||||
char Query[256];
|
char Query[256];
|
||||||
|
@ -1985,9 +1983,7 @@ void Enr_GetNotifEnrollmentRequest (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char
|
||||||
/* Role (row[1]) */
|
/* Role (row[1]) */
|
||||||
DesiredRole = Rol_ConvertUnsignedStrToRole (row[1]);
|
DesiredRole = Rol_ConvertUnsignedStrToRole (row[1]);
|
||||||
Str_Copy (SummaryStr,Txt_ROLES_SINGUL_Abc[DesiredRole][UsrDat.Sex],
|
Str_Copy (SummaryStr,Txt_ROLES_SINGUL_Abc[DesiredRole][UsrDat.Sex],
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
if (MaxChars)
|
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
|
||||||
|
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
if ((*ContentStr = (char *) malloc (256)))
|
if ((*ContentStr = (char *) malloc (256)))
|
||||||
|
|
|
@ -81,9 +81,8 @@ void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
|
||||||
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction);
|
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction);
|
||||||
|
|
||||||
void Enr_ReqAcceptRegisterInCrs (void);
|
void Enr_ReqAcceptRegisterInCrs (void);
|
||||||
void Enr_GetNotifEnrollment (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Enr_GetNotifEnrollment (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long CrsCod,long UsrCod,
|
long CrsCod,long UsrCod);
|
||||||
unsigned MaxChars);
|
|
||||||
void Enr_UpdateUsrData (struct UsrData *UsrDat);
|
void Enr_UpdateUsrData (struct UsrData *UsrDat);
|
||||||
void Enr_FilterUsrDat (struct UsrData *UsrDat);
|
void Enr_FilterUsrDat (struct UsrData *UsrDat);
|
||||||
void Enr_UpdateInstitutionCentreDepartment (void);
|
void Enr_UpdateInstitutionCentreDepartment (void);
|
||||||
|
@ -106,8 +105,9 @@ void Enr_RemAllStdsThisCrs (void);
|
||||||
unsigned Enr_RemAllStdsInCrs (struct Course *Crs);
|
unsigned Enr_RemAllStdsInCrs (struct Course *Crs);
|
||||||
void Enr_ReqSignUpInCrs (void);
|
void Enr_ReqSignUpInCrs (void);
|
||||||
void Enr_SignUpInCrs (void);
|
void Enr_SignUpInCrs (void);
|
||||||
void Enr_GetNotifEnrollmentRequest (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **ContentStr,
|
void Enr_GetNotifEnrollmentRequest (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long ReqCod,unsigned MaxChars,bool GetContent);
|
char **ContentStr,
|
||||||
|
long ReqCod,bool GetContent);
|
||||||
void Enr_AskIfRejectSignUp (void);
|
void Enr_AskIfRejectSignUp (void);
|
||||||
void Enr_RejectSignUp (void);
|
void Enr_RejectSignUp (void);
|
||||||
void Enr_ShowEnrollmentRequests (void);
|
void Enr_ShowEnrollmentRequests (void);
|
||||||
|
|
18
swad_exam.c
18
swad_exam.c
|
@ -1605,14 +1605,13 @@ static long Exa_GetParamExaCod (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Get summary and content about an exam announcement *************/
|
/************ Get summary and content about an exam announcement *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
|
||||||
// MaxChars must be > 3 + (2 + Cns_MAX_LENGTH_DATE + 6)
|
|
||||||
|
|
||||||
void Exa_GetSummaryAndContentExamAnnouncement (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Exa_GetSummaryAndContentExamAnnouncement (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long ExaCod,unsigned MaxChars,bool GetContent)
|
long ExaCod,bool GetContent)
|
||||||
{
|
{
|
||||||
extern const char *Txt_hours_ABBREVIATION;
|
extern const char *Txt_hours_ABBREVIATION;
|
||||||
|
char CrsNameAndDate[Crs_MAX_LENGTH_COURSE_FULL_NAME + (2 + Cns_MAX_LENGTH_DATE + 6) + 1];
|
||||||
|
|
||||||
/***** Initializations *****/
|
/***** Initializations *****/
|
||||||
Gbl.ExamAnns.ExaDat.ExaCod = ExaCod;
|
Gbl.ExamAnns.ExaDat.ExaCod = ExaCod;
|
||||||
|
@ -1629,19 +1628,16 @@ void Exa_GetSummaryAndContentExamAnnouncement (char SummaryStr[Cns_MAX_BYTES_TEX
|
||||||
Exa_GetNotifContentExamAnnouncement (ContentStr);
|
Exa_GetNotifContentExamAnnouncement (ContentStr);
|
||||||
|
|
||||||
/***** Summary *****/
|
/***** Summary *****/
|
||||||
/* Name of the course */
|
/* Name of the course and date of exam */
|
||||||
if (MaxChars)
|
sprintf (CrsNameAndDate,"%s, %04u-%02u-%02u %2u:%02u",
|
||||||
Str_LimitLengthHTMLStr (Gbl.ExamAnns.ExaDat.CrsFullName,
|
|
||||||
MaxChars - (2 + Cns_MAX_LENGTH_DATE + 6));
|
|
||||||
|
|
||||||
/* Date of exam */
|
|
||||||
sprintf (SummaryStr,"%s, %04u-%02u-%02u %2u:%02u",
|
|
||||||
Gbl.ExamAnns.ExaDat.CrsFullName,
|
Gbl.ExamAnns.ExaDat.CrsFullName,
|
||||||
Gbl.ExamAnns.ExaDat.ExamDate.Year,
|
Gbl.ExamAnns.ExaDat.ExamDate.Year,
|
||||||
Gbl.ExamAnns.ExaDat.ExamDate.Month,
|
Gbl.ExamAnns.ExaDat.ExamDate.Month,
|
||||||
Gbl.ExamAnns.ExaDat.ExamDate.Day,
|
Gbl.ExamAnns.ExaDat.ExamDate.Day,
|
||||||
Gbl.ExamAnns.ExaDat.StartTime.Hour,
|
Gbl.ExamAnns.ExaDat.StartTime.Hour,
|
||||||
Gbl.ExamAnns.ExaDat.StartTime.Minute);
|
Gbl.ExamAnns.ExaDat.StartTime.Minute);
|
||||||
|
Str_Copy (SummaryStr,CrsNameAndDate,
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
|
||||||
/***** Free memory of the exam announcement *****/
|
/***** Free memory of the exam announcement *****/
|
||||||
Exa_FreeMemExamAnnouncement ();
|
Exa_FreeMemExamAnnouncement ();
|
||||||
|
|
|
@ -99,8 +99,8 @@ void Exa_GetDateToHighlight (void);
|
||||||
|
|
||||||
void Exa_CreateListDatesOfExamAnnouncements (void);
|
void Exa_CreateListDatesOfExamAnnouncements (void);
|
||||||
void Exa_PutHiddenParamExaCod (long ExaCod);
|
void Exa_PutHiddenParamExaCod (long ExaCod);
|
||||||
void Exa_GetSummaryAndContentExamAnnouncement (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Exa_GetSummaryAndContentExamAnnouncement (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long ExaCod,unsigned MaxChars,bool GetContent);
|
long ExaCod,bool GetContent);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11141,8 +11141,9 @@ void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat,Cns_QuietOrVerbose_t Qu
|
||||||
|
|
||||||
#define Brw_MAX_BYTES_FILE_CONTENT_STR (100 + NAME_MAX + 100 + PATH_MAX + 100 + (Usr_MAX_BYTES_NAME + 1) * 3 + 100 + Fil_MAX_BYTES_FILE_SIZE_STRING)
|
#define Brw_MAX_BYTES_FILE_CONTENT_STR (100 + NAME_MAX + 100 + PATH_MAX + 100 + (Usr_MAX_BYTES_NAME + 1) * 3 + 100 + Fil_MAX_BYTES_FILE_SIZE_STRING)
|
||||||
|
|
||||||
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **ContentStr,
|
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long FilCod,unsigned MaxChars,bool GetContent)
|
char **ContentStr,
|
||||||
|
long FilCod,bool GetContent)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Filename;
|
extern const char *Txt_Filename;
|
||||||
extern const char *Txt_Folder;
|
extern const char *Txt_Folder;
|
||||||
|
@ -11163,9 +11164,7 @@ void Brw_GetSummaryAndContentOfFile (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],cha
|
||||||
|
|
||||||
/***** Copy file name into summary string *****/
|
/***** Copy file name into summary string *****/
|
||||||
Str_Copy (SummaryStr,FileMetadata.FilFolLnkName,
|
Str_Copy (SummaryStr,FileMetadata.FilFolLnkName,
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
if (MaxChars)
|
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
|
||||||
|
|
||||||
/***** Copy some file metadata into content string *****/
|
/***** Copy some file metadata into content string *****/
|
||||||
if (GetContent && ContentStr)
|
if (GetContent && ContentStr)
|
||||||
|
|
|
@ -247,8 +247,9 @@ void Brw_RemoveGrpZones (long CrsCod,long GrpCod);
|
||||||
void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs,Cns_QuietOrVerbose_t QuietOrVerbose);
|
void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs,Cns_QuietOrVerbose_t QuietOrVerbose);
|
||||||
void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat,Cns_QuietOrVerbose_t QuietOrVerbose);
|
void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat,Cns_QuietOrVerbose_t QuietOrVerbose);
|
||||||
|
|
||||||
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],char **ContentStr,
|
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
long FilCod,unsigned MaxChars,bool GetContent);
|
char **ContentStr,
|
||||||
|
long FilCod,bool GetContent);
|
||||||
|
|
||||||
unsigned Brw_ListDocsFound (const char *Query,
|
unsigned Brw_ListDocsFound (const char *Query,
|
||||||
const char *TitleSingular,const char *TitlePlural);
|
const char *TitleSingular,const char *TitlePlural);
|
||||||
|
|
|
@ -1176,10 +1176,10 @@ void Fol_GetAndShowRankingFollowers (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Fol_GetNotifFollower (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Fol_GetNotifFollower (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr)
|
char **ContentStr)
|
||||||
{
|
{
|
||||||
SummaryStr[0] = '\0';
|
SummaryStr[0] = '\0'; // Return nothing on error
|
||||||
|
|
||||||
if ((*ContentStr = (char *) malloc (1)))
|
if ((*ContentStr = (char *) malloc (1)))
|
||||||
*ContentStr[0] = '\0';
|
*ContentStr[0] = '\0';
|
||||||
|
|
|
@ -63,7 +63,7 @@ void Fol_UnfollowUsr2 (void);
|
||||||
|
|
||||||
void Fol_GetAndShowRankingFollowers (void);
|
void Fol_GetAndShowRankingFollowers (void);
|
||||||
|
|
||||||
void Fol_GetNotifFollower (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Fol_GetNotifFollower (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr);
|
char **ContentStr);
|
||||||
|
|
||||||
void Fol_RemoveUsrFromUsrFollow (long UsrCod);
|
void Fol_RemoveUsrFromUsrFollow (long UsrCod);
|
||||||
|
|
19
swad_forum.c
19
swad_forum.c
|
@ -1401,10 +1401,9 @@ static void For_GetPstData (long PstCod,long *UsrCod,time_t *CreatTimeUTC,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void For_GetSummaryAndContentForumPst (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void For_GetSummaryAndContentForumPst (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long PstCod,
|
long PstCod,bool GetContent)
|
||||||
unsigned MaxChars,bool GetContent)
|
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -1426,10 +1425,16 @@ void For_GetSummaryAndContentForumPst (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/***** Copy subject *****/
|
/***** Copy subject *****/
|
||||||
Str_Copy (SummaryStr,row[0],
|
// TODO: Do only direct copy when Subject will be VARCHAR(255)
|
||||||
Cns_MAX_BYTES_TEXT);
|
if (strlen (row[0]) > Cns_MAX_BYTES_SUMMARY_STRING)
|
||||||
if (MaxChars)
|
{
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
strncpy (SummaryStr,row[0],
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Str_Copy (SummaryStr,row[0],
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
|
||||||
/***** Copy content *****/
|
/***** Copy content *****/
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
|
|
|
@ -101,10 +101,9 @@ unsigned long For_GetNumPostsUsr (long UsrCod);
|
||||||
void For_DeleteThrFromReadThrs (long ThrCod);
|
void For_DeleteThrFromReadThrs (long ThrCod);
|
||||||
void For_RemoveUsrFromReadThrs (long UsrCod);
|
void For_RemoveUsrFromReadThrs (long UsrCod);
|
||||||
|
|
||||||
void For_GetSummaryAndContentForumPst (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void For_GetSummaryAndContentForumPst (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long PstCod,
|
long PstCod,bool GetContent);
|
||||||
unsigned MaxChars,bool GetContent);
|
|
||||||
|
|
||||||
void For_PutAllHiddenParamsForum (void);
|
void For_PutAllHiddenParamsForum (void);
|
||||||
void For_SetForumTypeAndRestrictAccess (void);
|
void For_SetForumTypeAndRestrictAccess (void);
|
||||||
|
|
|
@ -709,10 +709,9 @@ void Mrk_ShowMyMarks (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Mrk_GetNotifMyMarks (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Mrk_GetNotifMyMarks (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long MrkCod,long UsrCod,
|
long MrkCod,long UsrCod,bool GetContent)
|
||||||
unsigned MaxChars,bool GetContent)
|
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -783,8 +782,6 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
FileName);
|
FileName);
|
||||||
Str_Copy (SummaryStr,FileName,
|
Str_Copy (SummaryStr,FileName,
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_TEXT);
|
||||||
if (MaxChars)
|
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
|
||||||
|
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,9 +52,8 @@ void Mrk_ChangeNumRowsFooter (void);
|
||||||
|
|
||||||
bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks);
|
bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks);
|
||||||
void Mrk_ShowMyMarks (void);
|
void Mrk_ShowMyMarks (void);
|
||||||
void Mrk_GetNotifMyMarks (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Mrk_GetNotifMyMarks (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
long MrkCod,long UsrCod,
|
long MrkCod,long UsrCod,bool GetContent);
|
||||||
unsigned MaxChars,bool GetContent);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3004,9 +3004,8 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long MsgCod,
|
char **ContentStr,long MsgCod,bool GetContent)
|
||||||
unsigned MaxChars,bool GetContent)
|
|
||||||
{
|
{
|
||||||
extern const char *Txt_MSG_Subject;
|
extern const char *Txt_MSG_Subject;
|
||||||
char Query[128];
|
char Query[128];
|
||||||
|
@ -3029,10 +3028,16 @@ void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/***** Copy subject *****/
|
/***** Copy subject *****/
|
||||||
Str_Copy (SummaryStr,row[0],
|
// TODO: Do only direct copy when Subject will be VARCHAR(255)
|
||||||
Cns_MAX_BYTES_TEXT);
|
if (strlen (row[0]) > Cns_MAX_BYTES_SUMMARY_STRING)
|
||||||
if (MaxChars)
|
{
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
strncpy (SummaryStr,row[0],
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Str_Copy (SummaryStr,row[0],
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
|
||||||
/***** Copy subject *****/
|
/***** Copy subject *****/
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
|
|
|
@ -94,9 +94,8 @@ void Msg_GetDistinctCoursesInMyMessages (void);
|
||||||
void Msg_ShowFormSelectCourseSentOrRecMsgs (void);
|
void Msg_ShowFormSelectCourseSentOrRecMsgs (void);
|
||||||
void Msg_ShowFormToFilterMsgs (void);
|
void Msg_ShowFormToFilterMsgs (void);
|
||||||
void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]);
|
void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]);
|
||||||
void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long MsgCod,
|
char **ContentStr,long MsgCod,bool GetContent);
|
||||||
unsigned MaxChars,bool GetContent);
|
|
||||||
|
|
||||||
void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg);
|
void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg);
|
||||||
void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
|
void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
|
||||||
|
|
|
@ -745,9 +745,9 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Not_GetSummaryAndContentNotice (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Not_GetSummaryAndContentNotice (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long NotCod,
|
char **ContentStr,
|
||||||
unsigned MaxChars,bool GetContent)
|
long NotCod,bool GetContent)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -769,10 +769,16 @@ void Not_GetSummaryAndContentNotice (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/***** Copy summary *****/
|
/***** Copy summary *****/
|
||||||
Str_Copy (SummaryStr,row[0],
|
// TODO: Do only direct copy when a Subject of type VARCHAR(255) is available
|
||||||
Cns_MAX_BYTES_TEXT);
|
if (strlen (row[0]) > Cns_MAX_BYTES_SUMMARY_STRING)
|
||||||
if (MaxChars)
|
{
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
strncpy (SummaryStr,row[0],
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Str_Copy (SummaryStr,row[0],
|
||||||
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
|
|
||||||
/***** Copy content *****/
|
/***** Copy content *****/
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
|
|
|
@ -68,9 +68,9 @@ void Not_RemoveNotice (void);
|
||||||
|
|
||||||
void Not_GetNotCodToHighlight (void);
|
void Not_GetNotCodToHighlight (void);
|
||||||
void Not_ShowNotices (Not_Listing_t TypeNoticesListing);
|
void Not_ShowNotices (Not_Listing_t TypeNoticesListing);
|
||||||
void Not_GetSummaryAndContentNotice (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Not_GetSummaryAndContentNotice (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long NotCod,
|
char **ContentStr,
|
||||||
unsigned MaxChars,bool GetContent);
|
long NotCod,bool GetContent);
|
||||||
unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t Status,unsigned *NumNotif);
|
unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t Status,unsigned *NumNotif);
|
||||||
unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif);
|
unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif);
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ void Ntf_ShowMyNotifications (void)
|
||||||
time_t DateTimeUTC; // Date-time of the event
|
time_t DateTimeUTC; // Date-time of the event
|
||||||
Ntf_Status_t Status;
|
Ntf_Status_t Status;
|
||||||
Ntf_StatusTxt_t StatusTxt;
|
Ntf_StatusTxt_t StatusTxt;
|
||||||
char SummaryStr[Cns_MAX_BYTES_TEXT + 1];
|
char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1];
|
||||||
char *ContentStr;
|
char *ContentStr;
|
||||||
const char *ClassBackground;
|
const char *ClassBackground;
|
||||||
const char *ClassAnchor;
|
const char *ClassAnchor;
|
||||||
|
@ -604,7 +604,7 @@ void Ntf_ShowMyNotifications (void)
|
||||||
ContentStr = NULL;
|
ContentStr = NULL;
|
||||||
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
|
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
|
||||||
Cod,Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
Cod,Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Cfg_MAX_CHARS_NOTIF_SUMMARY_SWAD,false);
|
false);
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"2\"></td>"
|
"<td colspan=\"2\"></td>"
|
||||||
"<td colspan=\"5\" class=\"DAT LEFT_TOP\""
|
"<td colspan=\"5\" class=\"DAT LEFT_TOP\""
|
||||||
|
@ -853,11 +853,11 @@ Ntf_StatusTxt_t Ntf_GetStatusTxtFromStatusBits (Ntf_Status_t Status)
|
||||||
/******************* Get notification summary and content ********************/
|
/******************* Get notification summary and content ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ntf_GetNotifSummaryAndContent (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Ntf_GetNotifSummaryAndContent (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
Ntf_NotifyEvent_t NotifyEvent,
|
Ntf_NotifyEvent_t NotifyEvent,
|
||||||
long Cod,long CrsCod,long UsrCod,
|
long Cod,long CrsCod,long UsrCod,
|
||||||
unsigned MaxChars,bool GetContent)
|
bool GetContent)
|
||||||
{
|
{
|
||||||
SummaryStr[0] = '\0';
|
SummaryStr[0] = '\0';
|
||||||
|
|
||||||
|
@ -868,49 +868,49 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
case Ntf_EVENT_DOCUMENT_FILE:
|
case Ntf_EVENT_DOCUMENT_FILE:
|
||||||
case Ntf_EVENT_TEACHERS_FILE:
|
case Ntf_EVENT_TEACHERS_FILE:
|
||||||
case Ntf_EVENT_SHARED_FILE:
|
case Ntf_EVENT_SHARED_FILE:
|
||||||
Brw_GetSummaryAndContentOfFile (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Brw_GetSummaryAndContentOfFile (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_ASSIGNMENT:
|
case Ntf_EVENT_ASSIGNMENT:
|
||||||
Asg_GetNotifAssignment (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Asg_GetNotifAssignment (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_EXAM_ANNOUNCEMENT:
|
case Ntf_EVENT_EXAM_ANNOUNCEMENT:
|
||||||
Exa_GetSummaryAndContentExamAnnouncement (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Exa_GetSummaryAndContentExamAnnouncement (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_MARKS_FILE:
|
case Ntf_EVENT_MARKS_FILE:
|
||||||
Mrk_GetNotifMyMarks (SummaryStr,ContentStr,Cod,UsrCod,MaxChars,GetContent);
|
Mrk_GetNotifMyMarks (SummaryStr,ContentStr,Cod,UsrCod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_ENROLLMENT_STUDENT:
|
case Ntf_EVENT_ENROLLMENT_STUDENT:
|
||||||
case Ntf_EVENT_ENROLLMENT_TEACHER:
|
case Ntf_EVENT_ENROLLMENT_TEACHER:
|
||||||
Enr_GetNotifEnrollment (SummaryStr,CrsCod,UsrCod,MaxChars);
|
Enr_GetNotifEnrollment (SummaryStr,CrsCod,UsrCod);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_ENROLLMENT_REQUEST:
|
case Ntf_EVENT_ENROLLMENT_REQUEST:
|
||||||
Enr_GetNotifEnrollmentRequest (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Enr_GetNotifEnrollmentRequest (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_TIMELINE_COMMENT:
|
case Ntf_EVENT_TIMELINE_COMMENT:
|
||||||
case Ntf_EVENT_TIMELINE_FAV:
|
case Ntf_EVENT_TIMELINE_FAV:
|
||||||
case Ntf_EVENT_TIMELINE_SHARE:
|
case Ntf_EVENT_TIMELINE_SHARE:
|
||||||
case Ntf_EVENT_TIMELINE_MENTION:
|
case Ntf_EVENT_TIMELINE_MENTION:
|
||||||
// Cod is the code of the social publishing
|
// Cod is the code of the social publishing
|
||||||
Soc_GetNotifSocialPublishing (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Soc_GetNotifSocialPublishing (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_FOLLOWER:
|
case Ntf_EVENT_FOLLOWER:
|
||||||
Fol_GetNotifFollower (SummaryStr,ContentStr);
|
Fol_GetNotifFollower (SummaryStr,ContentStr);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_FORUM_POST_COURSE:
|
case Ntf_EVENT_FORUM_POST_COURSE:
|
||||||
case Ntf_EVENT_FORUM_REPLY:
|
case Ntf_EVENT_FORUM_REPLY:
|
||||||
For_GetSummaryAndContentForumPst (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
For_GetSummaryAndContentForumPst (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_NOTICE:
|
case Ntf_EVENT_NOTICE:
|
||||||
Not_GetSummaryAndContentNotice (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Not_GetSummaryAndContentNotice (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_MESSAGE:
|
case Ntf_EVENT_MESSAGE:
|
||||||
Msg_GetNotifMessage (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Msg_GetNotifMessage (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
if (Gbl.WebService.IsWebService)
|
if (Gbl.WebService.IsWebService)
|
||||||
/* Set the message as open by me, because I can read it in an extern application */
|
/* Set the message as open by me, because I can read it in an extern application */
|
||||||
Msg_SetReceivedMsgAsOpen (Cod,UsrCod);
|
Msg_SetReceivedMsgAsOpen (Cod,UsrCod);
|
||||||
break;
|
break;
|
||||||
case Ntf_EVENT_SURVEY:
|
case Ntf_EVENT_SURVEY:
|
||||||
Svy_GetNotifSurvey (SummaryStr,ContentStr,Cod,MaxChars,GetContent);
|
Svy_GetNotifSurvey (SummaryStr,ContentStr,Cod,GetContent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,11 +111,11 @@ void Ntf_ShowMyNotifications (void);
|
||||||
Ntf_NotifyEvent_t Ntf_GetParamNotifyEvent (void);
|
Ntf_NotifyEvent_t Ntf_GetParamNotifyEvent (void);
|
||||||
|
|
||||||
Ntf_StatusTxt_t Ntf_GetStatusTxtFromStatusBits (Ntf_Status_t Status);
|
Ntf_StatusTxt_t Ntf_GetStatusTxtFromStatusBits (Ntf_Status_t Status);
|
||||||
void Ntf_GetNotifSummaryAndContent (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Ntf_GetNotifSummaryAndContent (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
Ntf_NotifyEvent_t NotifyEvent,
|
Ntf_NotifyEvent_t NotifyEvent,
|
||||||
long Cod,long CrsCod,long UsrCod,
|
long Cod,long CrsCod,long UsrCod,
|
||||||
unsigned MaxChars,bool GetContent);
|
bool GetContent);
|
||||||
void Ntf_MarkNotifAsSeen (Ntf_NotifyEvent_t NotifyEvent,long Cod,long CrsCod,long ToUsrCod);
|
void Ntf_MarkNotifAsSeen (Ntf_NotifyEvent_t NotifyEvent,long Cod,long CrsCod,long ToUsrCod);
|
||||||
void Ntf_MarkNotifAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod);
|
void Ntf_MarkNotifAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod);
|
||||||
void Ntf_MarkNotifToOneUsrAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod,long ToUsrCod);
|
void Ntf_MarkNotifToOneUsrAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod,long ToUsrCod);
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
#define Soc_WIDTH_TIMELINE "560px"
|
#define Soc_WIDTH_TIMELINE "560px"
|
||||||
#define Soc_MAX_SHARERS_FAVERS_SHOWN 7 // Maximum number of users shown who have share/fav a social note
|
#define Soc_MAX_SHARERS_FAVERS_SHOWN 7 // Maximum number of users shown who have share/fav a social note
|
||||||
|
|
||||||
#define Soc_MAX_BYTES_SUMMARY 1000
|
|
||||||
#define Soc_MAX_CHARS_IN_POST 1000
|
#define Soc_MAX_CHARS_IN_POST 1000
|
||||||
|
|
||||||
// Number of recent publishings got and shown the first time, before refreshing
|
// Number of recent publishings got and shown the first time, before refreshing
|
||||||
|
@ -174,7 +173,7 @@ static void Soc_WriteDateTime (time_t TimeUTC);
|
||||||
static void Soc_GetAndWriteSocialPost (long PstCod);
|
static void Soc_GetAndWriteSocialPost (long PstCod);
|
||||||
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot);
|
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot);
|
||||||
static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
|
static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
|
||||||
char SummaryStr[Cns_MAX_BYTES_TEXT + 1],unsigned MaxChars);
|
char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1]);
|
||||||
static void Soc_PublishSocialNoteInTimeline (struct SocialPublishing *SocPub);
|
static void Soc_PublishSocialNoteInTimeline (struct SocialPublishing *SocPub);
|
||||||
|
|
||||||
static void Soc_PutFormToWriteNewPost (void);
|
static void Soc_PutFormToWriteNewPost (void);
|
||||||
|
@ -1264,7 +1263,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
|
||||||
bool ShowPhoto = false;
|
bool ShowPhoto = false;
|
||||||
char PhotoURL[PATH_MAX + 1];
|
char PhotoURL[PATH_MAX + 1];
|
||||||
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];
|
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];
|
||||||
char SummaryStr[Cns_MAX_BYTES_TEXT + 1];
|
char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1];
|
||||||
unsigned NumComments;
|
unsigned NumComments;
|
||||||
char IdNewComment[Act_MAX_LENGTH_ID];
|
char IdNewComment[Act_MAX_LENGTH_ID];
|
||||||
|
|
||||||
|
@ -1435,7 +1434,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write note summary */
|
/* Write note summary */
|
||||||
Soc_GetNoteSummary (SocNot,SummaryStr,Soc_MAX_BYTES_SUMMARY);
|
Soc_GetNoteSummary (SocNot,SummaryStr);
|
||||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s</div>",SummaryStr);
|
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s</div>",SummaryStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1872,7 +1871,7 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
|
static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
|
||||||
char SummaryStr[Cns_MAX_BYTES_TEXT + 1],unsigned MaxChars)
|
char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1])
|
||||||
{
|
{
|
||||||
SummaryStr[0] = '\0';
|
SummaryStr[0] = '\0';
|
||||||
|
|
||||||
|
@ -1888,19 +1887,19 @@ static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
|
||||||
case Soc_NOTE_DEG_SHA_PUB_FILE:
|
case Soc_NOTE_DEG_SHA_PUB_FILE:
|
||||||
case Soc_NOTE_CRS_DOC_PUB_FILE:
|
case Soc_NOTE_CRS_DOC_PUB_FILE:
|
||||||
case Soc_NOTE_CRS_SHA_PUB_FILE:
|
case Soc_NOTE_CRS_SHA_PUB_FILE:
|
||||||
Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,SocNot->Cod,MaxChars,false);
|
Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,SocNot->Cod,false);
|
||||||
break;
|
break;
|
||||||
case Soc_NOTE_EXAM_ANNOUNCEMENT:
|
case Soc_NOTE_EXAM_ANNOUNCEMENT:
|
||||||
Exa_GetSummaryAndContentExamAnnouncement (SummaryStr,NULL,SocNot->Cod,MaxChars,false);
|
Exa_GetSummaryAndContentExamAnnouncement (SummaryStr,NULL,SocNot->Cod,false);
|
||||||
break;
|
break;
|
||||||
case Soc_NOTE_SOCIAL_POST:
|
case Soc_NOTE_SOCIAL_POST:
|
||||||
// Not applicable
|
// Not applicable
|
||||||
break;
|
break;
|
||||||
case Soc_NOTE_FORUM_POST:
|
case Soc_NOTE_FORUM_POST:
|
||||||
For_GetSummaryAndContentForumPst (SummaryStr,NULL,SocNot->Cod,MaxChars,false);
|
For_GetSummaryAndContentForumPst (SummaryStr,NULL,SocNot->Cod,false);
|
||||||
break;
|
break;
|
||||||
case Soc_NOTE_NOTICE:
|
case Soc_NOTE_NOTICE:
|
||||||
Not_GetSummaryAndContentNotice (SummaryStr,NULL,SocNot->Cod,MaxChars,false);
|
Not_GetSummaryAndContentNotice (SummaryStr,NULL,SocNot->Cod,false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4733,9 +4732,9 @@ static void Soc_AddNotesJustRetrievedToTimelineThisSession (void)
|
||||||
/******************* Get notification of a new social post *******************/
|
/******************* Get notification of a new social post *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long PubCod,
|
char **ContentStr,
|
||||||
unsigned MaxChars,bool GetContent)
|
long PubCod,bool GetContent)
|
||||||
{
|
{
|
||||||
char Query[256];
|
char Query[256];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -4748,7 +4747,7 @@ void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
|
|
||||||
/***** Return nothing on error *****/
|
/***** Return nothing on error *****/
|
||||||
SocPub.PubType = Soc_PUB_UNKNOWN;
|
SocPub.PubType = Soc_PUB_UNKNOWN;
|
||||||
SummaryStr[0] = '\0';
|
SummaryStr[0] = '\0'; // Return nothing on error
|
||||||
Content[0] = '\0';
|
Content[0] = '\0';
|
||||||
|
|
||||||
/***** Get summary and content from social post from database *****/
|
/***** Get summary and content from social post from database *****/
|
||||||
|
@ -4809,12 +4808,12 @@ void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Copy summary string *****/
|
/***** Copy summary string *****/
|
||||||
Str_LimitLengthHTMLStr (Content,MaxChars);
|
Str_LimitLengthHTMLStr (Content,Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
Str_Copy (SummaryStr,Content,
|
Str_Copy (SummaryStr,Content,
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Soc_GetNoteSummary (&SocNot,SummaryStr,Soc_MAX_BYTES_SUMMARY);
|
Soc_GetNoteSummary (&SocNot,SummaryStr);
|
||||||
break;
|
break;
|
||||||
case Soc_PUB_COMMENT_TO_NOTE:
|
case Soc_PUB_COMMENT_TO_NOTE:
|
||||||
/***** Get content of social post from database *****/
|
/***** Get content of social post from database *****/
|
||||||
|
@ -4848,9 +4847,9 @@ void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Copy summary string *****/
|
/***** Copy summary string *****/
|
||||||
Str_LimitLengthHTMLStr (Content,MaxChars);
|
Str_LimitLengthHTMLStr (Content,Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
Str_Copy (SummaryStr,Content,
|
Str_Copy (SummaryStr,Content,
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,8 +174,8 @@ void Soc_RemoveUsrSocialContent (long UsrCod);
|
||||||
|
|
||||||
void Soc_ClearOldTimelinesDB (void);
|
void Soc_ClearOldTimelinesDB (void);
|
||||||
|
|
||||||
void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Soc_GetNotifSocialPublishing (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long PubCod,
|
char **ContentStr,
|
||||||
unsigned MaxChars,bool GetContent);
|
long PubCod,bool GetContent);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1400,8 +1400,9 @@ static void Svy_GetSurveyTxtFromDB (long SvyCod,char Txt[Cns_MAX_BYTES_TEXT + 1]
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// This function may be called inside a web service, so don't report error
|
// This function may be called inside a web service, so don't report error
|
||||||
|
|
||||||
void Svy_GetNotifSurvey (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Svy_GetNotifSurvey (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long SvyCod,unsigned MaxChars,bool GetContent)
|
char **ContentStr,
|
||||||
|
long SvyCod,bool GetContent)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -1424,9 +1425,7 @@ void Svy_GetNotifSurvey (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
||||||
|
|
||||||
/***** Get summary *****/
|
/***** Get summary *****/
|
||||||
Str_Copy (SummaryStr,row[0],
|
Str_Copy (SummaryStr,row[0],
|
||||||
Cns_MAX_BYTES_TEXT);
|
Cns_MAX_BYTES_SUMMARY_STRING);
|
||||||
if (MaxChars)
|
|
||||||
Str_LimitLengthHTMLStr (SummaryStr,MaxChars);
|
|
||||||
|
|
||||||
/***** Get content *****/
|
/***** Get content *****/
|
||||||
if (GetContent)
|
if (GetContent)
|
||||||
|
|
|
@ -94,8 +94,9 @@ void Svy_GetListSurveys (void);
|
||||||
void Svy_GetDataOfSurveyByCod (struct Survey *Svy);
|
void Svy_GetDataOfSurveyByCod (struct Survey *Svy);
|
||||||
void Svy_GetDataOfSurveyByFolder (struct Survey *Svy);
|
void Svy_GetDataOfSurveyByFolder (struct Survey *Svy);
|
||||||
void Svy_FreeListSurveys (void);
|
void Svy_FreeListSurveys (void);
|
||||||
void Svy_GetNotifSurvey (char SummaryStr[Cns_MAX_BYTES_TEXT + 1],
|
void Svy_GetNotifSurvey (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
|
||||||
char **ContentStr,long SvyCod,unsigned MaxChars,bool GetContent);
|
char **ContentStr,
|
||||||
|
long SvyCod,bool GetContent);
|
||||||
void Svy_AskRemSurvey (void);
|
void Svy_AskRemSurvey (void);
|
||||||
void Svy_RemoveSurvey (void);
|
void Svy_RemoveSurvey (void);
|
||||||
void Svy_AskResetSurvey (void);
|
void Svy_AskResetSurvey (void);
|
||||||
|
|
|
@ -2815,7 +2815,7 @@ int swad__getNotifications (struct soap *soap,
|
||||||
struct Course Crs;
|
struct Course Crs;
|
||||||
long Cod;
|
long Cod;
|
||||||
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];
|
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];
|
||||||
char SummaryStr[Cns_MAX_BYTES_TEXT + 1];
|
char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1];
|
||||||
char *ContentStr;
|
char *ContentStr;
|
||||||
Ntf_Status_t Status;
|
Ntf_Status_t Status;
|
||||||
size_t Length;
|
size_t Length;
|
||||||
|
@ -2982,7 +2982,7 @@ int swad__getNotifications (struct soap *soap,
|
||||||
ContentStr = NULL;
|
ContentStr = NULL;
|
||||||
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
|
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
|
||||||
Cod,Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
Cod,Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Cfg_MAX_CHARS_NOTIF_SUMMARY_WEB_SERVICE,true);
|
true);
|
||||||
|
|
||||||
Length = strlen (SummaryStr);
|
Length = strlen (SummaryStr);
|
||||||
getNotificationsOut->notificationsArray.__ptr[NumNotif].summary = (char *) soap_malloc (Gbl.soap,Length + 1);
|
getNotificationsOut->notificationsArray.__ptr[NumNotif].summary = (char *) soap_malloc (Gbl.soap,Length + 1);
|
||||||
|
@ -4682,7 +4682,7 @@ int swad__getMarks (struct soap *soap,
|
||||||
{
|
{
|
||||||
int ReturnCode;
|
int ReturnCode;
|
||||||
struct FileMetadata FileMetadata;
|
struct FileMetadata FileMetadata;
|
||||||
char SummaryStr[NAME_MAX + 1]; // Really not used
|
char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1]; // Not used
|
||||||
char *ContentStr;
|
char *ContentStr;
|
||||||
size_t Length;
|
size_t Length;
|
||||||
|
|
||||||
|
@ -4747,9 +4747,9 @@ int swad__getMarks (struct soap *soap,
|
||||||
|
|
||||||
/***** Get content *****/
|
/***** Get content *****/
|
||||||
ContentStr = NULL;
|
ContentStr = NULL;
|
||||||
Mrk_GetNotifMyMarks (SummaryStr,&ContentStr,
|
Mrk_GetNotifMyMarks (SummaryStr, // Not used
|
||||||
FileMetadata.FilCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
&ContentStr,
|
||||||
0,true);
|
FileMetadata.FilCod,Gbl.Usrs.Me.UsrDat.UsrCod,true);
|
||||||
if (ContentStr != NULL)
|
if (ContentStr != NULL)
|
||||||
{
|
{
|
||||||
Length = strlen (ContentStr);
|
Length = strlen (ContentStr);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user