Version 21.54.5: Nov 09, 2021 Queries moved from API module to database modules.

This commit is contained in:
acanas 2021-11-09 09:20:54 +01:00
parent eaad863026
commit 387244eed4
13 changed files with 85 additions and 123 deletions

View File

@ -124,6 +124,7 @@ cp -f /home/acanas/swad/swad/swad /var/www/cgi-bin/
#include "swad_message_database.h" #include "swad_message_database.h"
#include "swad_nickname_database.h" #include "swad_nickname_database.h"
#include "swad_notice.h" #include "swad_notice.h"
#include "swad_notice_database.h"
#include "swad_notification.h" #include "swad_notification.h"
#include "swad_notification_database.h" #include "swad_notification_database.h"
#include "swad_password.h" #include "swad_password.h"
@ -269,7 +270,10 @@ static void API_GetLstGrpsSel (const char *Groups);
static int API_GetMyLanguage (struct soap *soap); static int API_GetMyLanguage (struct soap *soap);
static int API_SendMessageToUsr (long OriginalMsgCod,long SenderUsrCod,long ReplyUsrCod,long RecipientUsrCod,bool NotifyByEmail,const char *Subject,const char *Content); static int API_SendMessageToUsr (long OriginalMsgCod,
long ReplyUsrCod,long RecipientUsrCod,
bool NotifyByEmail,
const char *Subject,const char *Content);
static int API_GetTstTags (struct soap *soap, static int API_GetTstTags (struct soap *soap,
long CrsCod,struct swad__getTestsOutput *getTestsOut); long CrsCod,struct swad__getTestsOutput *getTestsOut);
@ -3356,7 +3360,6 @@ int swad__sendMessage (struct soap *soap,
/* Send message to this user */ /* Send message to this user */
if ((ReturnCode = API_SendMessageToUsr ((long) messageCode, if ((ReturnCode = API_SendMessageToUsr ((long) messageCode,
Gbl.Usrs.Me.UsrDat.UsrCod,
ReplyUsrCod, ReplyUsrCod,
Gbl.Usrs.Other.UsrDat.UsrCod, Gbl.Usrs.Other.UsrDat.UsrCod,
NotifyByEmail, NotifyByEmail,
@ -3385,80 +3388,45 @@ int swad__sendMessage (struct soap *soap,
/*****************************************************************************/ /*****************************************************************************/
/************************* Send a message to one user ************************/ /************************* Send a message to one user ************************/
/*****************************************************************************/ /*****************************************************************************/
/*
API_SendMessageToUsr ((long) messageCode,
Gbl.Usrs.Me.UsrDat.UsrCod,ReplyUsrCod,Gbl.Usrs.Other.UsrDat.UsrCod,
NotifyByEmail,subject,body)) != SOAP_OK)
*/
static int API_SendMessageToUsr (long OriginalMsgCod, static int API_SendMessageToUsr (long OriginalMsgCod,
long SenderUsrCod,long ReplyUsrCod,long RecipientUsrCod, long ReplyUsrCod,long RecipientUsrCod,
bool NotifyByEmail, bool NotifyByEmail,
const char *Subject,const char *Content) const char *Subject,const char *Content)
{ {
static bool MsgAlreadyInserted = false; static bool MsgAlreadyInserted = false;
static long NewMsgCod; static long MsgCod;
/***** Create message *****/ /***** Create message *****/
if (!MsgAlreadyInserted) // The message is inserted only once in the table of messages sent if (!MsgAlreadyInserted) // The message is inserted only once in the table of messages sent
{ {
/***** Insert message subject and body in the database *****/ /***** Insert message subject and body in the database *****/
/* Get the code of the inserted item */ /* Get the code of the inserted item */
NewMsgCod = MsgCod = Msg_DB_CreateNewMsg (Subject,Content,
DB_QueryINSERTandReturnCode ("can not create message", -1L); // No media content
"INSERT INTO msg_content"
" (Subject,Content,MedCod)"
" VALUES"
" ('%s','%s',-1)",
Subject,
Content);
/* Insert message in sent messages */ /* Insert message in sent messages */
DB_QueryINSERT ("can not create message", Msg_DB_CreateSntMsg (MsgCod,
"INSERT INTO msg_snt" -1L); // No origin course
" (MsgCod,CrsCod,UsrCod,Expanded,CreatTime)"
" VALUES"
" (%ld,-1,%ld,'N',NOW())",
NewMsgCod,
SenderUsrCod);
MsgAlreadyInserted = true; MsgAlreadyInserted = true;
} }
/***** Insert message received in the database *****/ /***** Insert message received in the database *****/
DB_QueryINSERT ("can not create received message", Msg_DB_CreateRcvMsg (MsgCod,RecipientUsrCod,NotifyByEmail);
"INSERT INTO msg_rcv"
" (MsgCod,UsrCod,Notified,Open,Replied,Expanded)"
" VALUES"
" (%ld,%ld,'%c','N','N','N')",
NewMsgCod,
RecipientUsrCod,
NotifyByEmail ? 'Y' :
'N');
/***** Create notification for this recipient. /***** Create notification for this recipient.
If this recipient wants to receive notifications by email, activate the sending of a notification *****/ If this recipient wants to receive notifications by email,
DB_QueryINSERT ("can not create new notification event", activate the sending of a notification *****/
"INSERT INTO ntf_notifications" Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_MESSAGE,RecipientUsrCod,MsgCod,
" (NotifyEvent,ToUsrCod,FromUsrCod,InsCod,DegCod,CrsCod,Cod,TimeNotif,Status)" (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
" VALUES" 0),
" (%u,%ld,%ld,-1,-1,-1,%ld,NOW(),%u)", -1L,-1L,-1L,-1L);
(unsigned) Ntf_EVENT_MESSAGE,
RecipientUsrCod,
SenderUsrCod,
NewMsgCod,
(unsigned) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0));
/***** If this recipient is the original sender of a message been replied... *****/ /***** If this recipient is the original sender of a message been replied... *****/
if (RecipientUsrCod == ReplyUsrCod) if (RecipientUsrCod == ReplyUsrCod)
/***** ...then update received message setting Replied field to true *****/ /***** ...then update received message setting Replied field to true *****/
DB_QueryUPDATE ("can not update a received message", Msg_DB_SetRcvMsgAsReplied (OriginalMsgCod);
"UPDATE msg_rcv"
" SET Replied='Y'"
" WHERE MsgCod=%ld"
" AND UsrCod=%ld",
OriginalMsgCod,
SenderUsrCod);
return SOAP_OK; return SOAP_OK;
} }
@ -3512,15 +3480,7 @@ int swad__sendNotice (struct soap *soap,
/***** Insert notice in the database *****/ /***** Insert notice in the database *****/
/* Get the code of the inserted item */ /* Get the code of the inserted item */
NotCod = NotCod = Not_DB_InsertNotice (body);
DB_QueryINSERTandReturnCode ("can not create message",
"INSERT INTO not_notices"
" (CrsCod,UsrCod,CreatTime,Content,Status)"
" VALUES"
" (%ld,%ld,NOW(),'%s',%u)",
Gbl.Hierarchy.Crs.CrsCod,
Gbl.Usrs.Me.UsrDat.UsrCod,
body,(unsigned) Not_ACTIVE_NOTICE);
/***** Create notifications *****/ /***** Create notifications *****/
// TODO: create notifications // TODO: create notifications

View File

@ -523,8 +523,8 @@ static void Asg_ShowOneAssignment (struct Asg_Assignments *Assignments,
/***** Mark possible notification as seen *****/ /***** Mark possible notification as seen *****/
Ntf_DB_MarkNotifAsSeen (Ntf_EVENT_ASSIGNMENT, Ntf_DB_MarkNotifAsSeen (Ntf_EVENT_ASSIGNMENT,
AsgCod,Gbl.Hierarchy.Crs.CrsCod, AsgCod,Gbl.Hierarchy.Crs.CrsCod,
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/ */
#define Log_PLATFORM_VERSION "SWAD 21.54.4 (2021-11-09)" #define Log_PLATFORM_VERSION "SWAD 21.54.5 (2021-11-09)"
#define CSS_FILE "swad20.45.css" #define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.1.js" #define JS_FILE "swad20.69.1.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 21.54.5: Nov 09, 2021 Queries moved from API module to database modules. (322185 lines)
Version 21.54.4: Nov 09, 2021 Queries moved from API module to database modules. (322222 lines) Version 21.54.4: Nov 09, 2021 Queries moved from API module to database modules. (322222 lines)
Version 21.54.3: Nov 08, 2021 Queries moved from API module to database modules. (322095 lines) Version 21.54.3: Nov 08, 2021 Queries moved from API module to database modules. (322095 lines)
Version 21.54.2: Nov 08, 2021 Queries moved to module swad_user_database and other modules. (322054 lines) Version 21.54.2: Nov 08, 2021 Queries moved to module swad_user_database and other modules. (322054 lines)

View File

@ -112,7 +112,8 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void Enr_NotifyAfterEnrolment (struct UsrData *UsrDat,Rol_Role_t NewRole); static void Enr_NotifyAfterEnrolment (const struct UsrData *UsrDat,
Rol_Role_t NewRole);
static void Enr_ReqAdminUsrs (Rol_Role_t Role); static void Enr_ReqAdminUsrs (Rol_Role_t Role);
static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role); static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role);
@ -297,7 +298,8 @@ void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
/********* Create notification after register user in current course *********/ /********* Create notification after register user in current course *********/
/*****************************************************************************/ /*****************************************************************************/
static void Enr_NotifyAfterEnrolment (struct UsrData *UsrDat,Rol_Role_t NewRole) static void Enr_NotifyAfterEnrolment (const struct UsrData *UsrDat,
Rol_Role_t NewRole)
{ {
bool CreateNotif; bool CreateNotif;
bool NotifyByEmail; bool NotifyByEmail;
@ -334,13 +336,13 @@ static void Enr_NotifyAfterEnrolment (struct UsrData *UsrDat,Rol_Role_t NewRole)
NotifyByEmail = CreateNotif && !ItsMe && NotifyByEmail = CreateNotif && !ItsMe &&
(UsrDat->NtfEvents.SendEmail & (1 << NotifyEvent)); (UsrDat->NtfEvents.SendEmail & (1 << NotifyEvent));
if (CreateNotif) if (CreateNotif)
Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,UsrDat,-1L, Ntf_DB_StoreNotifyEventToUsr (NotifyEvent,UsrDat->UsrCod,-1L,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -97,8 +97,8 @@ static void Fol_PutHiddenParSelectedUsrsCods (void *SelectedUsrs);
static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed, static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed,
unsigned *NumNotFollowed); unsigned *NumNotFollowed);
static void Fol_FollowUsr (struct UsrData *UsrDat); static void Fol_FollowUsr (const struct UsrData *UsrDat);
static void Fol_UnfollowUsr (struct UsrData *UsrDat); static void Fol_UnfollowUsr (const struct UsrData *UsrDat);
/*****************************************************************************/ /*****************************************************************************/
/********************** Put link to show users to follow **********************/ /********************** Put link to show users to follow **********************/
@ -1098,7 +1098,7 @@ void Fol_UnfollowUsrs (void)
/******************************** Follow user ********************************/ /******************************** Follow user ********************************/
/*****************************************************************************/ /*****************************************************************************/
static void Fol_FollowUsr (struct UsrData *UsrDat) static void Fol_FollowUsr (const struct UsrData *UsrDat)
{ {
bool CreateNotif; bool CreateNotif;
bool NotifyByEmail; bool NotifyByEmail;
@ -1124,20 +1124,20 @@ static void Fol_FollowUsr (struct UsrData *UsrDat)
If this followed wants to receive notifications by email, If this followed wants to receive notifications by email,
activate the sending of a notification *****/ activate the sending of a notification *****/
if (CreateNotif) if (CreateNotif)
Ntf_DB_StoreNotifyEventToOneUser (Ntf_EVENT_FOLLOWER,UsrDat,Gbl.Usrs.Me.UsrDat.UsrCod, Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_FOLLOWER,UsrDat->UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/******************************* Unfollow user *******************************/ /******************************* Unfollow user *******************************/
/*****************************************************************************/ /*****************************************************************************/
static void Fol_UnfollowUsr (struct UsrData *UsrDat) static void Fol_UnfollowUsr (const struct UsrData *UsrDat)
{ {
/***** Avoid wrong cases *****/ /***** Avoid wrong cases *****/
if (Gbl.Usrs.Me.UsrDat.UsrCod <= 0 || if (Gbl.Usrs.Me.UsrDat.UsrCod <= 0 ||

View File

@ -844,13 +844,13 @@ void Msg_RecMsgFromUsr (void)
If this recipient wants to receive notifications by -mail, If this recipient wants to receive notifications by -mail,
activate the sending of a notification *****/ activate the sending of a notification *****/
if (CreateNotif) if (CreateNotif)
Ntf_DB_StoreNotifyEventToOneUser (Ntf_EVENT_MESSAGE,&UsrDstData,NewMsgCod, Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_MESSAGE,UsrDstData.UsrCod,NewMsgCod,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
/***** Show an alert indicating that the message has been sent successfully *****/ /***** Show an alert indicating that the message has been sent successfully *****/
Ale_ShowAlert (Ale_SUCCESS,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email : Ale_ShowAlert (Ale_SUCCESS,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
@ -1274,7 +1274,7 @@ static long Msg_InsertNewMsg (const char *Subject,const char *Content,
MsgCod = Msg_DB_CreateNewMsg (Subject,Content,Media->MedCod); MsgCod = Msg_DB_CreateNewMsg (Subject,Content,Media->MedCod);
/***** Insert message in sent messages *****/ /***** Insert message in sent messages *****/
Msg_DB_CreateSntMsg (MsgCod); Msg_DB_CreateSntMsg (MsgCod,Gbl.Hierarchy.Crs.CrsCod);
/***** Increment number of messages sent by me *****/ /***** Increment number of messages sent by me *****/
Prf_DB_IncrementNumMsgSntUsr (Gbl.Usrs.Me.UsrDat.UsrCod); Prf_DB_IncrementNumMsgSntUsr (Gbl.Usrs.Me.UsrDat.UsrCod);

View File

@ -76,7 +76,7 @@ long Msg_DB_CreateNewMsg (const char *Subject,const char *Content,long MedCod)
/************* Insert a message in the table of sent messages ****************/ /************* Insert a message in the table of sent messages ****************/
/*****************************************************************************/ /*****************************************************************************/
void Msg_DB_CreateSntMsg (long MsgCod) void Msg_DB_CreateSntMsg (long MsgCod,long CrsCod)
{ {
DB_QueryINSERT ("can not create sent message", DB_QueryINSERT ("can not create sent message",
"INSERT INTO msg_snt" "INSERT INTO msg_snt"
@ -84,7 +84,7 @@ void Msg_DB_CreateSntMsg (long MsgCod)
" VALUES" " VALUES"
" (%ld,%ld,%ld,'N',NOW())", " (%ld,%ld,%ld,'N',NOW())",
MsgCod, MsgCod,
Gbl.Hierarchy.Crs.CrsCod, CrsCod,
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
} }

View File

@ -47,7 +47,7 @@
/*****************************************************************************/ /*****************************************************************************/
long Msg_DB_CreateNewMsg (const char *Subject,const char *Content,long MedCod); long Msg_DB_CreateNewMsg (const char *Subject,const char *Content,long MedCod);
void Msg_DB_CreateSntMsg (long MsgCod); void Msg_DB_CreateSntMsg (long MsgCod,long CrsCod);
void Msg_DB_CreateRcvMsg (long MsgCod,long UsrCod,bool NotifyByEmail); void Msg_DB_CreateRcvMsg (long MsgCod,long UsrCod,bool NotifyByEmail);
void Msg_DB_SetRcvMsgAsReplied (long MsgCod); void Msg_DB_SetRcvMsgAsReplied (long MsgCod);
void Msg_DB_ExpandSntMsg (long MsgCod); void Msg_DB_ExpandSntMsg (long MsgCod);

View File

@ -1173,14 +1173,15 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
{ {
if ((UsrDat.NtfEvents.SendEmail & NotifyEventMask)) // Send notification by email if ((UsrDat.NtfEvents.SendEmail & NotifyEventMask)) // Send notification by email
{ {
Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,Cod, Ntf_DB_StoreNotifyEventToUsr (NotifyEvent,UsrDat.UsrCod,Cod,
(Ntf_Status_t) Ntf_STATUS_BIT_EMAIL, (Ntf_Status_t) Ntf_STATUS_BIT_EMAIL,
InsCod,CtrCod,DegCod,CrsCod); InsCod,CtrCod,DegCod,CrsCod);
NumUsrsToBeNotifiedByEMail++; NumUsrsToBeNotifiedByEMail++;
} }
else // Don't send notification by email else // Don't send notification by email
Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,Cod,(Ntf_Status_t) 0, Ntf_DB_StoreNotifyEventToUsr (NotifyEvent,UsrDat.UsrCod,Cod,
InsCod,CtrCod,DegCod,CrsCod); (Ntf_Status_t) 0,
InsCod,CtrCod,DegCod,CrsCod);
} }
} }

View File

@ -52,10 +52,9 @@ extern struct Globals Gbl;
/************** Store a notify event to one user into database ***************/ /************** Store a notify event to one user into database ***************/
/*****************************************************************************/ /*****************************************************************************/
void Ntf_DB_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, void Ntf_DB_StoreNotifyEventToUsr (Ntf_NotifyEvent_t NotifyEvent,
struct UsrData *UsrDat, long ToUsrCod,long Cod,Ntf_Status_t Status,
long Cod,Ntf_Status_t Status, long InsCod,long CtrCod,long DegCod,long CrsCod)
long InsCod,long CtrCod,long DegCod,long CrsCod)
{ {
DB_QueryINSERT ("can not create new notification event", DB_QueryINSERT ("can not create new notification event",
"INSERT INTO ntf_notifications" "INSERT INTO ntf_notifications"
@ -65,7 +64,7 @@ void Ntf_DB_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent,
" (%u,%ld,%ld," " (%u,%ld,%ld,"
"%ld,%ld,%ld,%ld,%ld,NOW(),%u)", "%ld,%ld,%ld,%ld,%ld,NOW(),%u)",
(unsigned) NotifyEvent, (unsigned) NotifyEvent,
UsrDat->UsrCod, ToUsrCod,
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,
InsCod, InsCod,
CtrCod, CtrCod,

View File

@ -42,10 +42,9 @@
/****************************** Public prototypes ****************************/ /****************************** Public prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
void Ntf_DB_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, void Ntf_DB_StoreNotifyEventToUsr (Ntf_NotifyEvent_t NotifyEvent,
struct UsrData *UsrDat, long ToUsrCod,long Cod,Ntf_Status_t Status,
long Cod,Ntf_Status_t Status, long InsCod,long CtrCod,long DegCod,long CrsCod);
long InsCod,long CtrCod,long DegCod,long CrsCod);
void Ntf_DB_UpdateMyLastAccessToNotifications (void); void Ntf_DB_UpdateMyLastAccessToNotifications (void);
void Ntf_DB_MarkAllMyNotifAsSeen (void); void Ntf_DB_MarkAllMyNotifAsSeen (void);
void Ntf_DB_MarkPendingNtfsAsSent (long ToUsrCod); void Ntf_DB_MarkPendingNtfsAsSent (long ToUsrCod);

View File

@ -757,13 +757,13 @@ void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *T
if (CreateNotif) if (CreateNotif)
{ {
NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION)); NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION));
Ntf_DB_StoreNotifyEventToOneUser (Ntf_EVENT_TL_MENTION,&UsrDat,PubCod, Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_TL_MENTION,UsrDat.UsrCod,PubCod,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
} }
} }
} }

View File

@ -87,13 +87,13 @@ void Tml_Ntf_CreateNotifToAuthor (long AuthorCod,long PubCod,
If this author wants to receive notifications by email, If this author wants to receive notifications by email,
activate the sending of a notification *****/ activate the sending of a notification *****/
if (CreateNotif) if (CreateNotif)
Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,PubCod, Ntf_DB_StoreNotifyEventToUsr (NotifyEvent,UsrDat.UsrCod,PubCod,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
Gbl.Hierarchy.Ctr.CtrCod, Gbl.Hierarchy.Ctr.CtrCod,
Gbl.Hierarchy.Deg.DegCod, Gbl.Hierarchy.Deg.DegCod,
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
} }
/***** Free memory used for user's data *****/ /***** Free memory used for user's data *****/