Version 16.111.8

This commit is contained in:
Antonio Cañas Vargas 2016-12-28 18:18:24 +01:00
parent 9b8aee740c
commit efd20a9e58
7 changed files with 17 additions and 12 deletions

View File

@ -189,13 +189,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.111.7 (2016-12-28)" #define Log_PLATFORM_VERSION "SWAD 16.111.8 (2016-12-28)"
#define CSS_FILE "swad16.111.5.css" #define CSS_FILE "swad16.111.5.css"
#define JS_FILE "swad16.101.js" #define JS_FILE "swad16.101.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.111.8: Dec 28, 2016 Fixed bug in notifications, reported by Coverity. (211119 lines)
Version 16.111.7: Dec 28, 2016 Fixed minor bug in groups, reported by Coverity. (211114 lines) Version 16.111.7: Dec 28, 2016 Fixed minor bug in groups, reported by Coverity. (211114 lines)
Version 16.111.6: Dec 28, 2016 Fixed bug in assigments, reported by Coverity. (211109 lines) Version 16.111.6: Dec 28, 2016 Fixed bug in assigments, reported by Coverity. (211109 lines)
Version 16.111.5: Dec 28, 2016 Changes in CSS related to tabs. (211084 lines) Version 16.111.5: Dec 28, 2016 Changes in CSS related to tabs. (211084 lines)

View File

@ -2201,7 +2201,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
/***** Set all the notifications from the course as removed, /***** Set all the notifications from the course as removed,
except notifications about new messages *****/ except notifications about new messages *****/
Ntf_MarkNotifInCrsAsRemoved (CrsCod,-1L); Ntf_MarkNotifInCrsAsRemoved (-1L,CrsCod);
/***** Remove information of the course ****/ /***** Remove information of the course ****/
/* Remove timetable of the course */ /* Remove timetable of the course */

View File

@ -3906,7 +3906,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,struct Course *
/***** Set all the notifications for this user in this course as removed, /***** Set all the notifications for this user in this course as removed,
except notifications about new messages *****/ except notifications about new messages *****/
Ntf_MarkNotifInCrsAsRemoved (Crs->CrsCod,UsrDat->UsrCod); Ntf_MarkNotifInCrsAsRemoved (UsrDat->UsrCod,Crs->CrsCod);
/***** Remove user from the table of courses-users *****/ /***** Remove user from the table of courses-users *****/
sprintf (Query,"DELETE FROM crs_usr" sprintf (Query,"DELETE FROM crs_usr"

View File

@ -4456,7 +4456,7 @@ void Brw_RemoveGrpFilesFromDB (long GrpCod)
/* Remove some info about files related to a course and a user from database */ /* Remove some info about files related to a course and a user from database */
/*****************************************************************************/ /*****************************************************************************/
void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long CrsCod,long UsrCod) void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long UsrCod,long CrsCod)
{ {
char Query[512]; char Query[512];

View File

@ -171,7 +171,7 @@ void Brw_RemoveCtrFilesFromDB (long CtrCod);
void Brw_RemoveDegFilesFromDB (long DegCod); void Brw_RemoveDegFilesFromDB (long DegCod);
void Brw_RemoveCrsFilesFromDB (long CrsCod); void Brw_RemoveCrsFilesFromDB (long CrsCod);
void Brw_RemoveGrpFilesFromDB (long GrpCod); void Brw_RemoveGrpFilesFromDB (long GrpCod);
void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long CrsCod,long UsrCod); void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long UsrCod,long CrsCod);
void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod); void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod);
void Brw_RemoveUsrFilesFromDB (long UsrCod); void Brw_RemoveUsrFilesFromDB (long UsrCod);

View File

@ -1005,20 +1005,24 @@ void Ntf_MarkNotifToOneUsrAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod,long
// However, notifications about new messages should not be removed // However, notifications about new messages should not be removed
// because the messages will remain available // because the messages will remain available
void Ntf_MarkNotifInCrsAsRemoved (long CrsCod,long ToUsrCod) void Ntf_MarkNotifInCrsAsRemoved (long ToUsrCod,long CrsCod)
{ {
char Query[512]; char Query[256];
/***** Set all notifications from the course as removed, /***** Set all notifications from the course as removed,
except notifications about new messages *****/ except notifications about new messages *****/
if (ToUsrCod > 0) // If the user code is specified if (ToUsrCod > 0) // If the user code is specified
sprintf (Query,"UPDATE notif SET Status=(Status | %u)" sprintf (Query,"UPDATE notif SET Status=(Status | %u)"
" WHERE ToUsrCod='%ld' AND CrsCod='%ld' AND NotifyEvent<>'%u'", " WHERE ToUsrCod='%ld'"
" AND CrsCod='%ld'"
" AND NotifyEvent<>'%u'", // messages will remain available
(unsigned) Ntf_STATUS_BIT_REMOVED, (unsigned) Ntf_STATUS_BIT_REMOVED,
ToUsrCod,CrsCod,(unsigned) Ntf_EVENT_MESSAGE); ToUsrCod,
else CrsCod,(unsigned) Ntf_EVENT_MESSAGE);
else // User code not specified ==> any user
sprintf (Query,"UPDATE notif SET Status=(Status | %u)" sprintf (Query,"UPDATE notif SET Status=(Status | %u)"
" WHERE CrsCod='%ld' AND NotifyEvent<>'%u'", " WHERE CrsCod='%ld'"
" AND NotifyEvent<>'%u'", // messages will remain available
(unsigned) Ntf_STATUS_BIT_REMOVED, (unsigned) Ntf_STATUS_BIT_REMOVED,
CrsCod,(unsigned) Ntf_EVENT_MESSAGE); CrsCod,(unsigned) Ntf_EVENT_MESSAGE);
DB_QueryUPDATE (Query,"can not set notification(s) as removed"); DB_QueryUPDATE (Query,"can not set notification(s) as removed");

View File

@ -114,7 +114,7 @@ void Ntf_GetNotifSummaryAndContent (char *SummaryStr,char **ContentStr,
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);
void Ntf_MarkNotifInCrsAsRemoved (long CrsCod,long ToUsrCod); void Ntf_MarkNotifInCrsAsRemoved (long ToUsrCod,long CrsCod);
void Ntf_MarkNotifOneFileAsRemoved (const char *Path); void Ntf_MarkNotifOneFileAsRemoved (const char *Path);
void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path); void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path);
void Ntf_MarkNotifFilesInGroupAsRemoved (long GrpCod); void Ntf_MarkNotifFilesInGroupAsRemoved (long GrpCod);