Version 23.42.1: Nov 05, 2023 Code refactoring in notifications.

This commit is contained in:
acanas 2023-11-05 19:44:03 +01:00
parent 7fcf9f48ed
commit ea3ec4837a
42 changed files with 242 additions and 246 deletions

View File

@ -3030,7 +3030,7 @@ int swad__getNotifications (struct soap *soap,
ContentStr = NULL;
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
Cod,Hie[Hie_CRS].HieCod,Gbl.Usrs.Me.UsrDat.UsrCod,
true);
Ntf_GET_CONTENT);
Length = strlen (SummaryStr);
getNotificationsOut->notificationsArray.__ptr[NumNotif].summary =
@ -5123,7 +5123,8 @@ int swad__getMarks (struct soap *soap,
ContentStr = NULL;
Mrk_GetNotifMyMarks (SummaryStr, // Not used
&ContentStr,
FileMetadata.FilCod,Gbl.Usrs.Me.UsrDat.UsrCod,true);
FileMetadata.FilCod,Gbl.Usrs.Me.UsrDat.UsrCod,
Ntf_GET_CONTENT);
if (ContentStr != NULL)
{
Length = strlen (ContentStr);

View File

@ -896,7 +896,7 @@ void Acc_AskIfRemoveMyAccount (void)
/***** Show question and button to remove my user account *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_completely_eliminate_your_user_account);
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_completely_eliminate_your_user_account);
/* Show my record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Me.UsrDat);
@ -908,7 +908,7 @@ void Acc_AskIfRemoveMyAccount (void)
Frm_EndForm ();
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
@ -925,7 +925,7 @@ static void Acc_AskIfRemoveOtherUsrAccount (void)
{
/***** Show question and button to remove user account *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_completely_eliminate_the_following_user);
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_completely_eliminate_the_following_user);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -938,7 +938,7 @@ static void Acc_AskIfRemoveOtherUsrAccount (void)
Frm_EndForm ();
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}

View File

@ -109,14 +109,14 @@ void Adm_ReqAddAdm (Hie_Level_t Level)
{
/***** Show question and button to register user as administrator *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
Gbl.Hierarchy.Node[Level].FullName);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
/* End alert */
Ale_ShowAlertAndButton2 (Enr_ActNewAdm[Level],NULL,NULL,
Ale_ShowAlertAndButtonEnd (Enr_ActNewAdm[Level],NULL,NULL,
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Btn_CREATE_BUTTON,Txt_Register_user_IN_A_COURSE_OR_DEGREE);
}
@ -369,14 +369,14 @@ static void Adm_AskIfRemAdm (Usr_MeOrOther_t MeOrOther,Hie_Level_t Level)
{
/***** Show question and button to remove user as administrator *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Question[MeOrOther],
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Question[MeOrOther],
Gbl.Hierarchy.Node[Level].FullName);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
/* End alert */
Ale_ShowAlertAndButton2 (ActRemAdm[Level],NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActRemAdm[Level],NULL,NULL,
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Btn_REMOVE_BUTTON,TxtButton[MeOrOther]);
}

View File

@ -72,7 +72,7 @@ static void Ale_ResetAlert (size_t NumAlert);
static void Ale_ShowFixAlert (Ale_AlertType_t AlertType,const char *Txt);
static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Txt);
static void Ale_ShowFixAlertAndButtonBegin (Ale_AlertType_t AlertType,const char *Txt);
/*****************************************************************************/
/**************************** Create a new alert *****************************/
@ -281,8 +281,8 @@ static void Ale_ShowFixAlert (Ale_AlertType_t AlertType,const char *Txt)
if (AlertType != Ale_NONE)
{
/****** Print fix alert and button ******/
Ale_ShowFixAlertAndButton1 (AlertType,Txt);
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowFixAlertAndButtonBegin (AlertType,Txt);
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}
@ -297,22 +297,23 @@ void Ale_ShowLastAlertAndButton (Act_Action_t NextAction,const char *Anchor,cons
Btn_Button_t Button,const char *TxtButton)
{
/***** Show last alert and then reset it *****/
Ale_ShowLastAlertAndButton1 ();
Ale_ShowLastAlertAndButtonBegin ();
/***** Show button *****/
Ale_ShowAlertAndButton2 (NextAction,Anchor,OnSubmit,
FuncPars,Args,
Button,TxtButton);
Ale_ShowAlertAndButtonEnd (NextAction,Anchor,OnSubmit,
FuncPars,Args,
Button,TxtButton);
}
/*****************************************************************************/
/********** Show the first part of more recent alert with a button ***********/
/*****************************************************************************/
void Ale_ShowLastAlertAndButton1 (void)
void Ale_ShowLastAlertAndButtonBegin (void)
{
/***** Show last alert *****/
Ale_ShowFixAlertAndButton1 (Ale_GetTypeOfLastAlert (),Ale_GetTextOfLastAlert ());
Ale_ShowFixAlertAndButtonBegin (Ale_GetTypeOfLastAlert (),
Ale_GetTextOfLastAlert ());
/***** Reset last alert *****/
Ale_ResetLastAlert ();
@ -356,10 +357,10 @@ void Ale_ShowAlertAndButton (Act_Action_t NextAction,const char *Anchor,const ch
Err_NotEnoughMemoryExit ();
/****** Print fix alert and button ******/
Ale_ShowFixAlertAndButton1 (AlertType,Txt);
Ale_ShowAlertAndButton2 (NextAction,Anchor,OnSubmit,
FuncPars,Args,
Button,TxtButton);
Ale_ShowFixAlertAndButtonBegin (AlertType,Txt);
Ale_ShowAlertAndButtonEnd (NextAction,Anchor,OnSubmit,
FuncPars,Args,
Button,TxtButton);
/***** Free text *****/
free (Txt);
@ -369,7 +370,7 @@ void Ale_ShowAlertAndButton (Act_Action_t NextAction,const char *Anchor,const ch
/******** Show the first part of a formatted-text alert with a button ********/
/*****************************************************************************/
void Ale_ShowAlertAndButton1 (Ale_AlertType_t AlertType,const char *fmt,...)
void Ale_ShowAlertAndButtonBegin (Ale_AlertType_t AlertType,const char *fmt,...)
{
va_list ap;
int NumBytesPrinted;
@ -383,7 +384,7 @@ void Ale_ShowAlertAndButton1 (Ale_AlertType_t AlertType,const char *fmt,...)
Err_NotEnoughMemoryExit ();
/****** Print start of fix alert and button ******/
Ale_ShowFixAlertAndButton1 (AlertType,Txt);
Ale_ShowFixAlertAndButtonBegin (AlertType,Txt);
/***** Free text *****/
free (Txt);
@ -393,7 +394,7 @@ void Ale_ShowAlertAndButton1 (Ale_AlertType_t AlertType,const char *fmt,...)
/*********** Show the first part of a fix-text alert with a button ***********/
/*****************************************************************************/
static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Txt)
static void Ale_ShowFixAlertAndButtonBegin (Ale_AlertType_t AlertType,const char *Txt)
{
extern const char *Txt_Close;
char IdAlert[Frm_MAX_BYTES_ID + 1];
@ -463,9 +464,9 @@ static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Tx
/*************** Show the second part of an alert with a button **************/
/*****************************************************************************/
void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
void (*FuncPars) (void *Args),void *Args,
Btn_Button_t Button,const char *TxtButton)
void Ale_ShowAlertAndButtonEnd (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
void (*FuncPars) (void *Args),void *Args,
Btn_Button_t Button,const char *TxtButton)
{
/***** Optional button *****/
if (NextAction != ActUnk &&

View File

@ -72,7 +72,7 @@ void Ale_ShowAlert (Ale_AlertType_t AlertType,const char *fmt,...);
void Ale_ShowLastAlertAndButton (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
void (*FuncPars) (void *Args),void *Args,
Btn_Button_t Button,const char *TxtButton);
void Ale_ShowLastAlertAndButton1 (void);
void Ale_ShowLastAlertAndButtonBegin (void);
void Ale_ShowAlertRemove (Act_Action_t NextAction,const char *Anchor,
void (*FuncPars) (void *Args),void *Args,
const char *Txt,const char *Title);
@ -80,10 +80,10 @@ void Ale_ShowAlertAndButton (Act_Action_t NextAction,const char *Anchor,const ch
void (*FuncPars) (void *Args),void *Args,
Btn_Button_t Button,const char *TxtButton,
Ale_AlertType_t AlertType,const char *fmt,...);
void Ale_ShowAlertAndButton1 (Ale_AlertType_t AlertType,const char *fmt,...);
void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
void (*FuncPars) (void *Args),void *Args,
Btn_Button_t Button,const char *TxtButton);
void Ale_ShowAlertAndButtonBegin (Ale_AlertType_t AlertType,const char *fmt,...);
void Ale_ShowAlertAndButtonEnd (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
void (*FuncPars) (void *Args),void *Args,
Btn_Button_t Button,const char *TxtButton);
void Ale_ShowAlertYouCanNotLeaveFieldEmpty (void);
void Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission (void);

View File

@ -986,7 +986,7 @@ static void Asg_FreeListAssignments (struct Asg_Assignments *Assignments)
void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long AsgCod,bool GetContent)
long AsgCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1004,7 +1004,7 @@ void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Str_Copy (SummaryStr,row[0],Ntf_MAX_BYTES_SUMMARY);
/***** Get content *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
Length = strlen (row[1]);
if ((*ContentStr = malloc (Length + 1)) == NULL)

View File

@ -96,7 +96,7 @@ void Asg_GetAssignmentDataByFolder (struct Asg_Assignment *Asg);
void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long AsgCod,bool GetContent);
long AsgCod,Ntf_GetContent_t GetContent);
void Asg_ReqRemAssignment (void);
void Asg_RemoveAssignment (void);

View File

@ -9112,7 +9112,7 @@ void Brw_RemoveUsrWorksInAllCrss (struct Usr_Data *UsrDat)
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long FilCod,bool GetContent)
long FilCod,Ntf_GetContent_t GetContent)
{
extern const char *Txt_Filename;
extern const char *Txt_Folder;
@ -9124,7 +9124,7 @@ void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
/***** Return nothing on error *****/
SummaryStr[0] = '\0'; // Return nothing on error
if (GetContent && ContentStr)
if (GetContent == Ntf_GET_CONTENT && ContentStr)
*ContentStr = NULL;
/***** Get file metadata *****/
@ -9135,7 +9135,7 @@ void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Str_Copy (SummaryStr,FileMetadata.FilFolLnk.Name,Ntf_MAX_BYTES_SUMMARY);
/***** Copy some file metadata into content string *****/
if (GetContent && ContentStr)
if (GetContent == Ntf_GET_CONTENT && ContentStr)
{
/* Get publisher */
if (FileMetadata.PublisherUsrCod > 0)

View File

@ -262,7 +262,7 @@ void Brw_RemoveUsrWorksInAllCrss (struct Usr_Data *UsrDat);
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long FilCod,bool GetContent);
long FilCod,Ntf_GetContent_t GetContent);
void Brw_ListDocsFound (MYSQL_RES **mysql_res,unsigned NumDocs,
const char *TitleSingular,const char *TitlePlural);

View File

@ -411,7 +411,7 @@ void Cfe_ReqRemCallForExam (void)
/***** Show question and button to remove call for exam *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_call_for_exam);
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_call_for_exam);
/* Show call for exam */
Cfe_AllocMemCallForExam (&CallsForExams);
@ -421,7 +421,7 @@ void Cfe_ReqRemCallForExam (void)
Cfe_FreeMemCallForExam (&CallsForExams);
/* End alert */
Ale_ShowAlertAndButton2 (ActRemCfe,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActRemCfe,NULL,NULL,
Cfe_PutParExaCod,&CallsForExams.ExaCod,
Btn_REMOVE_BUTTON,Act_GetActionText (ActRemCfe));
}
@ -1554,7 +1554,7 @@ static void Cfe_PutParExaCod (void *ExaCod)
void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long ExaCod,bool GetContent)
long ExaCod,Ntf_GetContent_t GetContent)
{
extern const char *Txt_hours_ABBREVIATION;
struct Cfe_CallsForExams CallsForExams;
@ -1573,7 +1573,7 @@ void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY
Cfe_GetCallForExamDataByCod (&CallsForExams,ExaCod);
/***** Content *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
Cfe_GetNotifContentCallForExam (&CallsForExams,ContentStr);
/***** Summary *****/

View File

@ -133,7 +133,7 @@ bool Cfe_CheckIfICanEditCallsForExams (void);
void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long ExaCod,bool GetContent);
long ExaCod,Ntf_GetContent_t GetContent);
void Cfe_BuildSessionAndDate (const struct Cfe_CallsForExams *CallsForExams,
char SessionAndDate[Cfe_MAX_BYTES_SESSION_AND_DATE]);

View File

@ -633,10 +633,11 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/
#define Log_PLATFORM_VERSION "SWAD 23.42 (2023-10-29)"
#define Log_PLATFORM_VERSION "SWAD 23.42.1 (2023-11-05)"
#define CSS_FILE "swad23.35.1.css"
#define JS_FILE "swad22.49.js"
/*
Version 23.42.1: Nov 05, 2023 Code refactoring in notifications. (335447 lines)
Version 23.42: Oct 29, 2023 Code refactoring in view/edit/print. (335453 lines)
Version 23.41.2: Oct 29, 2023 Code refactoring in class photo. (335361 lines)
Version 23.41.1: Oct 29, 2023 Code refactoring in view/edit/print. (335361 lines)

View File

@ -1787,7 +1787,7 @@ void Crs_ContEditAfterChgCrs (void)
if (Ale_GetTypeOfLastAlert () == Ale_SUCCESS)
{
/***** Begin alert *****/
Ale_ShowLastAlertAndButton1 ();
Ale_ShowLastAlertAndButtonBegin ();
/***** Put button to go to course changed *****/
Crs_PutButtonToGoToCrs ();
@ -1822,7 +1822,7 @@ void Crs_ContEditAfterChgCrs (void)
Crs_PutButtonToRegisterInCrs ();
/***** End alert *****/
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}

View File

@ -886,33 +886,6 @@ mysql> DESCRIBE crs_requests;
"UNIQUE INDEX(CrsCod,UsrCod),"
"INDEX(UsrCod))");
/***** Table crs_users *****/
/*
mysql> DESCRIBE crs_users;
+----------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------+------+-----+---------+-------+
| CrsCod | int(11) | NO | PRI | NULL | |
| UsrCod | int(11) | NO | PRI | NULL | |
| Role | tinyint(4) | NO | MUL | 0 | |
| Accepted | enum('N','Y') | NO | | N | |
+----------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_users ("
"CrsCod INT NOT NULL,"
"UsrCod INT NOT NULL,"
"Role TINYINT NOT NULL DEFAULT 0,"
"Accepted ENUM('N','Y') NOT NULL DEFAULT 'N',"
"UNIQUE INDEX(CrsCod,UsrCod),"
"UNIQUE INDEX(CrsCod,UsrCod,Role),"
"UNIQUE INDEX(UsrCod,CrsCod),"
"UNIQUE INDEX(UsrCod,CrsCod,Role),"
"UNIQUE INDEX(Role,CrsCod,UsrCod),"
"UNIQUE INDEX(Role,UsrCod,CrsCod),"
"INDEX(CrsCod,Role),"
"INDEX(UsrCod,Role))");
/***** Table crs_user_settings *****/
/*
mysql> DESCRIBE crs_user_settings;
@ -947,6 +920,33 @@ mysql> DESCRIBE crs_user_settings;
"ListWithPhotos ENUM('N','Y') NOT NULL DEFAULT 'Y',"
"UNIQUE INDEX(UsrCod,CrsCod))");
/***** Table crs_users *****/
/*
mysql> DESCRIBE crs_users;
+----------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------+------+-----+---------+-------+
| CrsCod | int(11) | NO | PRI | NULL | |
| UsrCod | int(11) | NO | PRI | NULL | |
| Role | tinyint(4) | NO | MUL | 0 | |
| Accepted | enum('N','Y') | NO | | N | |
+----------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS crs_users ("
"CrsCod INT NOT NULL,"
"UsrCod INT NOT NULL,"
"Role TINYINT NOT NULL DEFAULT 0,"
"Accepted ENUM('N','Y') NOT NULL DEFAULT 'N',"
"UNIQUE INDEX(CrsCod,UsrCod),"
"UNIQUE INDEX(CrsCod,UsrCod,Role),"
"UNIQUE INDEX(UsrCod,CrsCod),"
"UNIQUE INDEX(UsrCod,CrsCod,Role),"
"UNIQUE INDEX(Role,CrsCod,UsrCod),"
"UNIQUE INDEX(Role,UsrCod,CrsCod),"
"INDEX(CrsCod,Role),"
"INDEX(UsrCod,Role))");
/***** Table ctr_centers *****/
/*
mysql> DESCRIBE ctr_centers;
@ -2525,12 +2525,12 @@ mysql> DESCRIBE prg_resources;
+--------+-------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------------------------------------------------------------------------+------+-----+---------+----------------+
| RscCod | int | NO | PRI | NULL | auto_increment |
| ItmCod | int | NO | MUL | -1 | |
| RscInd | int | NO | | 0 | |
| RscCod | int(11) | NO | PRI | NULL | auto_increment |
| ItmCod | int(11) | NO | MUL | -1 | |
| RscInd | int(11) | NO | | 0 | |
| Hidden | enum('N','Y') | NO | | N | |
| Type | enum('non','asg','prj','cfe','exa','gam','rub','doc','mrk','att','for','svy') | NO | | non | |
| Cod | int | NO | | -1 | |
| Cod | int(11) | NO | | -1 | |
| Title | varchar(2047) | NO | | NULL | |
+--------+-------------------------------------------------------------------------------+------+-----+---------+----------------+
7 rows in set (0,00 sec)
@ -2567,13 +2567,13 @@ mysql> DESCRIBE prj_projects;
+--------------+--------------------------------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------------------------------------+------+-----+---------------------+----------------+
| PrjCod | int | NO | PRI | NULL | auto_increment |
| CrsCod | int | NO | MUL | -1 | |
| DptCod | int | NO | | -1 | |
| PrjCod | int(11) | NO | PRI | NULL | auto_increment |
| CrsCod | int(11) | NO | MUL | -1 | |
| DptCod | int(11) | NO | | -1 | |
| Locked | enum('N','Y') | NO | | N | |
| Hidden | enum('N','Y') | NO | | N | |
| Assigned | enum('N','Y') | NO | | N | |
| NumStds | int | NO | | 1 | |
| NumStds | int(11) | NO | | 1 | |
| Proposal | enum('new','modified','unmodified') | NO | | new | |
| CreatTime | datetime | NO | | NULL | |
| ModifTime | datetime | NO | | NULL | |
@ -2614,27 +2614,6 @@ mysql> DESCRIBE prj_projects;
"INDEX(CrsCod,DptCod),"
"INDEX(CrsCod,ReviewStatus))");
/***** Table prj_reviews *****/
/*
mysql> DESCRIBE prj_reviews;
+------------+--------------------------------------+------+-----+----------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------------------------------+------+-----+----------+-------+
| PrjCod | int | NO | MUL | NULL | |
| ReviewTime | datetime | NO | | NULL | |
| Result | enum('negative','solved','positive') | NO | | negative | |
| Txt | text | NO | | NULL | |
+------------+--------------------------------------+------+-----+----------+-------+
4 rows in set (0,00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS prj_reviews ("
"PrjCod INT NOT NULL,"
"ReviewTime DATETIME NOT NULL,"
"Result ENUM('negative','solved','positive') NOT NULL DEFAULT 'negative',"
"Txt TEXT NOT NULL," // Cns_MAX_BYTES_TEXT
"INDEX(PrjCod,ReviewTime),"
"INDEX(PrjCod,Result))");
/***** Table prj_rubrics *****/
/*
mysql> DESCRIBE prj_rubrics;
@ -2767,15 +2746,15 @@ mysql> DESCRIBE roo_check_in;
/***** Table rsc_clipboards *****/
/*
mysql> DESCRIBE rsc_clipboards;
+----------+-------------------------------------------------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------------------------------------------------------------------------+------+-----+---------+-------+
| UsrCod | int | NO | PRI | NULL | |
| CrsCod | int | NO | PRI | NULL | |
| Type | enum('non','asg','prj','cfe','exa','gam','rub','doc','mrk','att','for','svy') | NO | PRI | non | |
| Cod | int | NO | PRI | -1 | |
| CopyTime | timestamp | YES | MUL | NULL | |
+----------+-------------------------------------------------------------------------------+------+-----+---------+-------+
+----------+-------------------------------------------------------------------------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------------------------------------------------------------------------+------+-----+-------------------+-----------------------------+
| UsrCod | int(11) | NO | PRI | NULL | |
| CrsCod | int(11) | NO | PRI | NULL | |
| Type | enum('non','asg','prj','cfe','exa','gam','rub','doc','mrk','att','for','svy') | NO | PRI | non | |
| Cod | int(11) | NO | PRI | -1 | |
| CopyTime | timestamp | NO | MUL | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+----------+-------------------------------------------------------------------------------+------+-----+-------------------+-----------------------------+
5 rows in set (0,00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS rsc_clipboards ("

View File

@ -1723,7 +1723,7 @@ void Enr_AskRemAllStdsThisCrs (void)
{
/***** Show question and button to remove students *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
NumStds,
Gbl.Hierarchy.Node[Hie_CRS].FullName);
@ -1735,7 +1735,7 @@ void Enr_AskRemAllStdsThisCrs (void)
Frm_EndForm ();
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}
@ -1889,7 +1889,7 @@ void Enr_SignUpInCrs (void)
void Enr_GetNotifEnrolmentRequest (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long ReqCod,bool GetContent)
long ReqCod,Ntf_GetContent_t GetContent)
{
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
MYSQL_RES *mysql_res;
@ -1919,7 +1919,7 @@ void Enr_GetNotifEnrolmentRequest (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Str_Copy (SummaryStr,Txt_ROLES_SINGUL_Abc[DesiredRole][UsrDat.Sex],
Ntf_MAX_BYTES_SUMMARY);
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
/* Write desired role into content */
if (asprintf (ContentStr,
"%s", // TODO: Write more info in this content
@ -1977,7 +1977,7 @@ void Enr_AskIfRejectSignUp (void)
{
/***** Show question and button to reject user's enrolment request *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_reject_the_enrolment_request_,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_reject_the_enrolment_request_,
Gbl.Usrs.Other.UsrDat.FullName,
Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Other.UsrDat.Sex],
Gbl.Hierarchy.Node[Hie_CRS].FullName);
@ -1986,7 +1986,7 @@ void Enr_AskIfRejectSignUp (void)
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
/* End alert */
Ale_ShowAlertAndButton2 (ActRejSignUp,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActRejSignUp,NULL,NULL,
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Btn_REMOVE_BUTTON,Txt_Reject);
}
@ -3105,7 +3105,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct Usr_Data *UsrDat)
/***** Show question and button to remove user as administrator *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Question[MeOrOther],
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Question[MeOrOther],
Gbl.Hierarchy.Node[Hie_CRS].FullName);
/* Show user's record */
@ -3121,7 +3121,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct Usr_Data *UsrDat)
Frm_EndForm ();
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}

View File

@ -111,7 +111,7 @@ void Enr_ReqSignUpInCrs (void);
void Enr_SignUpInCrs (void);
void Enr_GetNotifEnrolmentRequest (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long ReqCod,bool GetContent);
long ReqCod,Ntf_GetContent_t GetContent);
void Enr_AskIfRejectSignUp (void);
void Enr_RejectSignUp (void);
void Enr_ShowEnrolmentRequests (void);

View File

@ -1065,9 +1065,9 @@ static void ExaSet_ListQuestionForEdition (struct Qst_Question *Question,
ClassFeedback[Question->Validity]);
/* Show answers */
Qst_WriteAnswersBank (Question,
ClassTxt[Question->Validity],
ClassFeedback[Question->Validity]);
Qst_WriteAnswers (Question,
ClassTxt[Question->Validity],
ClassFeedback[Question->Validity]);
HTM_ARTICLE_End ();
HTM_TD_End ();

View File

@ -1107,7 +1107,7 @@ static void For_GetPstData (long PstCod,long *UsrCod,time_t *CreatTimeUTC,
void For_GetSummaryAndContentForumPst (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long PstCod,bool GetContent)
long PstCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1125,7 +1125,7 @@ void For_GetSummaryAndContentForumPst (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1
Str_Copy (SummaryStr,row[0],Ntf_MAX_BYTES_SUMMARY);
/***** Copy content *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
Length = strlen (row[1]);

View File

@ -135,7 +135,7 @@ void For_ShowPostsOfAThread (struct For_Forums *Forums,
void For_GetSummaryAndContentForumPst (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long PstCod,bool GetContent);
long PstCod,Ntf_GetContent_t GetContent);
void For_PutAllParsForum (unsigned NumPageThreads,
unsigned NumPagePosts,

View File

@ -634,7 +634,7 @@ void Mrk_ShowMyMarks (void)
void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long MrkCod,long UsrCod,bool GetContent)
long MrkCod,long UsrCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -693,7 +693,7 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
FileName);
Str_Copy (SummaryStr,FileName,Cns_MAX_BYTES_TEXT);
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
/* Header (row[3]) */
if (sscanf (row[3],"%u",&(Marks.Header)) != 1)

View File

@ -53,6 +53,6 @@ bool Mrk_CheckFileOfMarks (const char *Path,struct Mrk_Properties *Marks);
void Mrk_ShowMyMarks (void);
void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long MrkCod,long UsrCod,bool GetContent);
long MrkCod,long UsrCod,Ntf_GetContent_t GetContent);
#endif

View File

@ -1833,7 +1833,7 @@ static void Med_AlertThirdPartyCookies (void)
/***** Alert to inform about third party cookies *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_INFO,Txt_To_watch_multimedia_content_from_another_website_you_have_to_accept_third_party_cookies_in_your_personal_settings);
Ale_ShowAlertAndButtonBegin (Ale_INFO,Txt_To_watch_multimedia_content_from_another_website_you_have_to_accept_third_party_cookies_in_your_personal_settings);
/* Put form to change cookies preferences */
if (!Frm_CheckIfInside ())
@ -1843,7 +1843,7 @@ static void Med_AlertThirdPartyCookies (void)
Txt_Settings,NULL);
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}

View File

@ -942,12 +942,12 @@ void Msg_ReqDelAllRecMsgs (void)
if (Messages.FilterContent[0])
{
if (Messages.ShowOnlyUnreadMsgs)
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Messages.FilterFromTo[0] ? Messages.FilterFromTo :
Txt_any_user,
Messages.FilterCrsShrtName,Messages.FilterContent);
else
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Messages.FilterFromTo[0] ? Messages.FilterFromTo :
Txt_any_user,
Messages.FilterCrsShrtName,Messages.FilterContent);
@ -955,12 +955,12 @@ void Msg_ReqDelAllRecMsgs (void)
else
{
if (Messages.ShowOnlyUnreadMsgs)
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
Messages.FilterFromTo[0] ? Messages.FilterFromTo :
Txt_any_user,
Messages.FilterCrsShrtName);
else
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
Messages.FilterFromTo[0] ? Messages.FilterFromTo :
Txt_any_user,
Messages.FilterCrsShrtName);
@ -971,7 +971,7 @@ void Msg_ReqDelAllRecMsgs (void)
Msg_ShowSntOrRcvMessages (&Messages);
/* End alert */
Ale_ShowAlertAndButton2 (ActDelAllRcvMsg,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActDelAllRcvMsg,NULL,NULL,
Msg_PutParsMsgsFilters,&Messages,
Btn_REMOVE_BUTTON,Txt_Delete_messages_received);
}
@ -999,12 +999,12 @@ void Msg_ReqDelAllSntMsgs (void)
/***** Show question and button to remove messages received *****/
/* Begin alert */
if (Messages.FilterContent[0])
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Messages.FilterFromTo[0] ? Messages.FilterFromTo :
Txt_any_user,
Messages.FilterCrsShrtName,Messages.FilterContent);
else
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
Messages.FilterFromTo[0] ? Messages.FilterFromTo :
Txt_any_user,
Messages.FilterCrsShrtName);
@ -1014,7 +1014,7 @@ void Msg_ReqDelAllSntMsgs (void)
Msg_ShowSntOrRcvMessages (&Messages);
/* End alert */
Ale_ShowAlertAndButton2 (ActDelAllSntMsg,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActDelAllSntMsg,NULL,NULL,
Msg_PutParsMsgsFilters,&Messages,
Btn_REMOVE_BUTTON,Txt_Delete_messages_sent);
}
@ -2188,7 +2188,7 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
/*****************************************************************************/
void Msg_GetNotifMessage (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,long MsgCod,bool GetContent)
char **ContentStr,long MsgCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -2214,7 +2214,7 @@ void Msg_GetNotifMessage (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Str_Copy (SummaryStr,row[0],Ntf_MAX_BYTES_SUMMARY);
/***** Copy subject *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
Length = strlen (row[1]);
if ((*ContentStr = malloc (Length + 1)) == NULL)

View File

@ -110,7 +110,7 @@ void Msg_ShowRecMsgs (void);
void Msg_PutParsMsgsFilters (void *Messages);
void Msg_GetNotifMessage (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,long MsgCod,bool GetContent);
char **ContentStr,long MsgCod,Ntf_GetContent_t GetContent);
void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg);
void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassTxt,const char *ClassBg);

View File

@ -262,13 +262,13 @@ void Not_ReqRemNotice (void)
/***** Show question and button to remove this notice *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_notice);
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_notice);
/* Show notice */
Not_GetDataAndShowNotice (NotCod);
/* End alert */
Ale_ShowAlertAndButton2 (ActRemNot,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActRemNot,NULL,NULL,
Not_PutParNotCod,&NotCod,
Btn_REMOVE_BUTTON,Act_GetActionText (ActRemNot));
@ -639,7 +639,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
void Not_GetSummaryAndContentNotice (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long NotCod,bool GetContent)
long NotCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -667,7 +667,7 @@ void Not_GetSummaryAndContentNotice (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Str_Copy (SummaryStr,row[0],Ntf_MAX_BYTES_SUMMARY);
/***** Copy content *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
Length = strlen (row[0]);
if ((*ContentStr = malloc (Length + 1)) == NULL)

View File

@ -77,7 +77,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod);
void Not_GetSummaryAndContentNotice (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long NotCod,bool GetContent);
long NotCod,Ntf_GetContent_t GetContent);
unsigned Not_GetNumNotices (Hie_Level_t Level,Not_Status_t Status,unsigned *NumNotif);
unsigned Not_GetNumNoticesDeleted (Hie_Level_t Level,unsigned *NumNotif);

View File

@ -614,8 +614,9 @@ void Ntf_ShowMyNotifications (void)
ContentStr = NULL;
Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent,
Cod,Hie[Hie_CRS].HieCod,Gbl.Usrs.Me.UsrDat.UsrCod,
false);
Cod,Hie[Hie_CRS].HieCod,
Gbl.Usrs.Me.UsrDat.UsrCod,
Ntf_DONT_GET_CONTENT);
HTM_TR_Begin (NULL);
HTM_TD_Begin ("colspan=\"2\"");
@ -893,7 +894,7 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
Ntf_NotifyEvent_t NotifyEvent,
long Cod,long CrsCod,long UsrCod,
bool GetContent)
Ntf_GetContent_t GetContent)
{
SummaryStr[0] = '\0';

View File

@ -109,6 +109,14 @@ typedef enum
Ntf_STATUS_EMAIL_SENT = 3, // --11 (Status & Ntf_STATUS_BIT_EMAIL) && (Status & Ntf_STATUS_BIT_SENT)
} Ntf_StatusTxt_t;
#define Ntf_NUM_GET_CONTENT 2
typedef enum
{
Ntf_DONT_GET_CONTENT = 0,
Ntf_GET_CONTENT = 1,
} Ntf_GetContent_t;
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
@ -122,7 +130,7 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
Ntf_NotifyEvent_t NotifyEvent,
long Cod,long CrsCod,long UsrCod,
bool GetContent);
Ntf_GetContent_t GetContent);
void Ntf_MarkNotifOneFileAsRemoved (const char *Path);
void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path);

View File

@ -434,14 +434,14 @@ void Pho_ReqRemMyPhoto (void)
{
/***** Show question and button to remove my photo *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_your_photo);
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_remove_your_photo);
/* Show current photo */
Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,Gbl.Usrs.Me.PhotoURL,
ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM);
/* End alert */
Ale_ShowAlertAndButton2 (ActRemMyPho,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActRemMyPho,NULL,NULL,
NULL,NULL,
Btn_REMOVE_BUTTON,Txt_Remove);
}
@ -521,7 +521,7 @@ void Pho_ReqRemUsrPhoto (void)
{
/***** Show question and button to remove user's photo *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_photo_of_X,
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_photo_of_X,
Gbl.Usrs.Other.UsrDat.FullName);
/* Show current photo */
@ -529,7 +529,7 @@ void Pho_ReqRemUsrPhoto (void)
ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM);
/* End alert */
Ale_ShowAlertAndButton2 (NextAction[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs],NULL,NULL,
Ale_ShowAlertAndButtonEnd (NextAction[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs],NULL,NULL,
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Btn_REMOVE_BUTTON,Txt_Remove);
}
@ -734,29 +734,29 @@ static bool Pho_ReceivePhotoAndDetectFaces (Usr_MeOrOther_t MeOrOther,
/***** Begin alert to the user about the number of faces detected in the image *****/
if (NumFaces.Total == 0)
Ale_ShowAlertAndButton1 (Ale_WARNING,Txt_Could_not_detect_any_face_in_front_position_);
Ale_ShowAlertAndButtonBegin (Ale_WARNING,Txt_Could_not_detect_any_face_in_front_position_);
else if (NumFaces.Total == 1)
{
if (NumFaces.Green == 1)
Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_A_face_marked_in_green_has_been_detected_);
Ale_ShowAlertAndButtonBegin (Ale_SUCCESS,Txt_A_face_marked_in_green_has_been_detected_);
else
Ale_ShowAlertAndButton1 (Ale_WARNING,Txt_A_face_marked_in_red_has_been_detected_);
Ale_ShowAlertAndButtonBegin (Ale_WARNING,Txt_A_face_marked_in_red_has_been_detected_);
}
else // NumFacesTotal > 1
{
if (NumFaces.Red == 0)
Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_X_faces_marked_in_green_have_been_detected_,
Ale_ShowAlertAndButtonBegin (Ale_SUCCESS,Txt_X_faces_marked_in_green_have_been_detected_,
NumFaces.Green);
else if (NumFaces.Green == 0)
Ale_ShowAlertAndButton1 (Ale_WARNING,Txt_X_faces_marked_in_red_have_been_detected_,
Ale_ShowAlertAndButtonBegin (Ale_WARNING,Txt_X_faces_marked_in_red_have_been_detected_,
NumFaces.Red);
else // NumFaces.Green > 0
{
if (NumFaces.Green == 1)
Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_X_faces_have_been_detected_in_front_position_1_Z_,
Ale_ShowAlertAndButtonBegin (Ale_SUCCESS,Txt_X_faces_have_been_detected_in_front_position_1_Z_,
NumFaces.Total,NumFaces.Red);
else
Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
Ale_ShowAlertAndButtonBegin (Ale_SUCCESS,Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
NumFaces.Total,NumFaces.Green,NumFaces.Red);
}
}
@ -798,7 +798,7 @@ static bool Pho_ReceivePhotoAndDetectFaces (Usr_MeOrOther_t MeOrOther,
HTM_DIV_End ();
/***** End alert *****/
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
@ -892,7 +892,7 @@ static void Pho_ChangePhoto2 (void)
char *Img;
/***** Begin alert *****/
Ale_ShowLastAlertAndButton1 ();
Ale_ShowLastAlertAndButtonBegin ();
/***** Show the three images resulting of the processing *****/
HTM_TABLE_BeginWide ();
@ -917,7 +917,7 @@ static void Pho_ChangePhoto2 (void)
HTM_TABLE_End ();
/***** End alert *****/
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}

View File

@ -54,7 +54,7 @@
#include "swad_role.h"
#include "swad_setting.h"
#include "swad_string.h"
#include "swad_view_edit.h"
#include "swad_view.h"
/*****************************************************************************/
/************** External global variables from others modules ****************/

View File

@ -3038,7 +3038,7 @@ static void Prj_ReqRemUsrFromPrj (struct Prj_Projects *Projects,
{
/***** Show question and button to remove user as a role from project *****/
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Question[Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod)],
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,Question[Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod)],
Txt_PROJECT_ROLES_SINGUL_abc[RoleInPrj][Gbl.Usrs.Other.UsrDat.Sex],
Projects->Prj.Title);
@ -3056,7 +3056,7 @@ static void Prj_ReqRemUsrFromPrj (struct Prj_Projects *Projects,
Frm_EndForm ();
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,NULL,NULL,Btn_NO_BUTTON,NULL);
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,NULL,NULL,Btn_NO_BUTTON,NULL);
}
else
Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission ();

View File

@ -80,6 +80,23 @@ const char *Qst_StrAnswerTypesXML[Qst_NUM_ANS_TYPES] =
extern struct Globals Gbl;
/*****************************************************************************/
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static void Qst_WriteIntAns (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback);
static void Qst_WriteFltAns (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback);
static void Qst_WriteTF_Ans (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback);
static void Qst_WriteChoAns (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback);
/*****************************************************************************/
/***************************** Test constructor ******************************/
/*****************************************************************************/
@ -524,7 +541,7 @@ void Qst_ListQuestionForEdition (struct Qst_Question *Question,
Qst_WriteQstFeedback (Question->Feedback,"Qst_TXT_LIGHT");
/* Show answers */
Qst_WriteAnswersBank (Question,"Qst_TXT","Qst_TXT_LIGHT");
Qst_WriteAnswers (Question,"Qst_TXT","Qst_TXT_LIGHT");
}
else
{
@ -994,7 +1011,7 @@ void Qst_WriteQuestionListing (struct Qst_Questions *Questions,unsigned QstInd)
/* Feedback (row[4]) and answers */
Qst_WriteQstFeedback (Questions->Question.Feedback,"Qst_TXT_LIGHT");
Qst_WriteAnswersBank (&Questions->Question,"Qst_TXT","Qst_TXT_LIGHT");
Qst_WriteAnswers (&Questions->Question,"Qst_TXT","Qst_TXT_LIGHT");
HTM_TD_End ();
/* Number of times this question has been answered */
@ -1305,7 +1322,7 @@ void Qst_WriteQuestionRowForSelection (unsigned QstInd,
Qst_WriteQstFeedback (Question->Feedback,"Qst_TXT_LIGHT");
/* Write answers */
Qst_WriteAnswersBank (Question,"Qst_TXT","Qst_TXT_LIGHT");
Qst_WriteAnswers (Question,"Qst_TXT","Qst_TXT_LIGHT");
HTM_TD_End ();
/***** End table row *****/
@ -1340,24 +1357,24 @@ void Qst_PutParsEditQst (void *Questions)
/**************** Get and write the answers of a test question ***************/
/*****************************************************************************/
void Qst_WriteAnswersBank (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback)
void Qst_WriteAnswers (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback)
{
void (*Tst_WriteAnsBank[Qst_NUM_ANS_TYPES]) (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback) =
void (*Tst_WriteAns[Qst_NUM_ANS_TYPES]) (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback) =
{
[Qst_ANS_INT ] = Qst_WriteIntAnsBank,
[Qst_ANS_FLOAT ] = Qst_WriteFltAnsBank,
[Qst_ANS_TRUE_FALSE ] = Qst_WriteTF_AnsBank,
[Qst_ANS_UNIQUE_CHOICE ] = Qst_WriteChoAnsBank,
[Qst_ANS_MULTIPLE_CHOICE] = Qst_WriteChoAnsBank,
[Qst_ANS_TEXT ] = Qst_WriteChoAnsBank,
[Qst_ANS_INT ] = Qst_WriteIntAns,
[Qst_ANS_FLOAT ] = Qst_WriteFltAns,
[Qst_ANS_TRUE_FALSE ] = Qst_WriteTF_Ans,
[Qst_ANS_UNIQUE_CHOICE ] = Qst_WriteChoAns,
[Qst_ANS_MULTIPLE_CHOICE] = Qst_WriteChoAns,
[Qst_ANS_TEXT ] = Qst_WriteChoAns,
};
/***** Write answers *****/
Tst_WriteAnsBank[Question->Answer.Type] (Question,ClassTxt,ClassFeedback);
Tst_WriteAns[Question->Answer.Type] (Question,ClassTxt,ClassFeedback);
}
/*****************************************************************************/
@ -1391,9 +1408,9 @@ void Qst_ListOneQstToEdit (struct Qst_Questions *Questions)
/****************** Write integer answer when editing a test *****************/
/*****************************************************************************/
void Qst_WriteIntAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
static void Qst_WriteIntAns (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_GetSuffix ());
HTM_TxtF ("(%ld)",Question->Answer.Integer);
@ -1404,9 +1421,9 @@ void Qst_WriteIntAnsBank (struct Qst_Question *Question,
/****************** Write float answer when editing a test *******************/
/*****************************************************************************/
void Qst_WriteFltAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
static void Qst_WriteFltAns (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_GetSuffix ());
HTM_Txt ("([");
@ -1421,9 +1438,9 @@ void Qst_WriteFltAnsBank (struct Qst_Question *Question,
/*********** Write false / true answer when listing test questions ***********/
/*****************************************************************************/
void Qst_WriteTF_AnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
static void Qst_WriteTF_Ans (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback)
{
/***** Write answer *****/
HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_GetSuffix ());
@ -1437,9 +1454,9 @@ void Qst_WriteTF_AnsBank (struct Qst_Question *Question,
/**** Write single or multiple choice answer when listing test questions *****/
/*****************************************************************************/
void Qst_WriteChoAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback)
static void Qst_WriteChoAns (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback)
{
extern const char *Txt_TST_Answer_given_by_the_teachers;
unsigned NumOpt;

View File

@ -175,28 +175,14 @@ void Qst_WriteQuestionRowForSelection (unsigned QstInd,
void Qst_PutParsEditQst (void *Questions);
void Qst_WriteAnswersBank (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback);
void Qst_WriteAnswers (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback);
void Qst_ListOneQstToEdit (struct Qst_Questions *Questions);
//-----------------------------------------------------------------------------
void Qst_WriteIntAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback);
void Qst_WriteFltAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback);
void Qst_WriteTF_AnsBank (struct Qst_Question *Question,
const char *ClassTxt,
__attribute__((unused)) const char *ClassFeedback);
void Qst_WriteChoAnsBank (struct Qst_Question *Question,
const char *ClassTxt,
const char *ClassFeedback);
//-----------------------------------------------------------------------------
void Qst_GetCorrectIntAnswerFromDB (struct Qst_Question *Question);
void Qst_GetCorrectFltAnswerFromDB (struct Qst_Question *Question);
void Qst_GetCorrectTF_AnswerFromDB (struct Qst_Question *Question);

View File

@ -1321,7 +1321,7 @@ void Svy_FreeListSurveys (struct Svy_Surveys *Surveys)
void Svy_GetNotifSurvey (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long SvyCod,bool GetContent)
long SvyCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -1339,7 +1339,7 @@ void Svy_GetNotifSurvey (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Str_Copy (SummaryStr,row[0],Ntf_MAX_BYTES_SUMMARY);
/***** Get content *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
Length = strlen (row[1]);
if ((*ContentStr = malloc (Length + 1)) == NULL)

View File

@ -113,7 +113,7 @@ void Svy_GetSurveyDataByFolder (struct Svy_Survey *Svy);
void Svy_FreeListSurveys (struct Svy_Surveys *Surveys);
void Svy_GetNotifSurvey (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long SvyCod,bool GetContent);
long SvyCod,Ntf_GetContent_t GetContent);
void Svy_AskRemSurvey (void);
void Svy_RemoveSurvey (void);
void Svy_AskResetSurvey (void);

View File

@ -104,7 +104,7 @@ static void TmlCom_PutFormToRemoveComm (const struct Tml_Timeline *Timeline,
static long TmlCom_ReceiveComm (void);
static void TmlCom_RequestRemovalComm (struct Tml_Timeline *Timeline);
static void TmlCom_ReqRemComm (struct Tml_Timeline *Timeline);
static void TmlCom_PutParsRemoveComm (void *Timeline);
static void TmlCom_RemoveComm (void);
@ -841,7 +841,7 @@ void TmlCom_ReqRemComUsr (void)
HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Request the removal of comment in note *****/
TmlCom_RequestRemovalComm (&Timeline);
TmlCom_ReqRemComm (&Timeline);
/***** Write timeline again (user) *****/
Tml_ShowTimelineUsr (&Timeline);
@ -858,13 +858,13 @@ void TmlCom_ReqRemComGbl (void)
Tml_InitTimelineGbl (&Timeline);
/***** Request the removal of comment in note *****/
TmlCom_RequestRemovalComm (&Timeline);
TmlCom_ReqRemComm (&Timeline);
/***** Write timeline again (global) *****/
Tml_ShowNoteAndTimelineGbl (&Timeline);
}
static void TmlCom_RequestRemovalComm (struct Tml_Timeline *Timeline)
static void TmlCom_ReqRemComm (struct Tml_Timeline *Timeline)
{
extern const char *Txt_Do_you_really_want_to_remove_the_following_comment;
struct TmlCom_Comment Com;
@ -906,8 +906,7 @@ static void TmlCom_RequestRemovalComm (struct Tml_Timeline *Timeline)
/* End alert */
Timeline->PubCod = Com.PubCod; // Publication to be removed
TmlFrm_EndAlertRemove (Timeline,TmlFrm_REM_COMM,
TmlCom_PutParsRemoveComm);
TmlFrm_EndAlertRemove (Timeline,TmlFrm_REM_COMM,TmlCom_PutParsRemoveComm);
/***** Free media *****/
Med_MediaDestructor (&Com.Content.Media);

View File

@ -950,7 +950,7 @@ unsigned Tml_DB_GetPubDataByCod (long PubCod,MYSQL_RES **mysql_res)
if (PubCod <= 0)
return 0;
/***** Get data of note from database *****/
/***** Get data of publication from database *****/
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of publication",
"SELECT PubCod," // row[0]

View File

@ -330,7 +330,7 @@ void TmlFrm_FormToShowHiddenComms (long NotCod,
void TmlFrm_BeginAlertRemove (const char *QuestionTxt)
{
Ale_ShowAlertAndButton1 (Ale_QUESTION,QuestionTxt);
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,QuestionTxt);
}
void TmlFrm_EndAlertRemove (struct Tml_Timeline *Timeline,
@ -338,11 +338,11 @@ void TmlFrm_EndAlertRemove (struct Tml_Timeline *Timeline,
void (*FuncPars) (void *Args))
{
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
Ale_ShowAlertAndButton2 (TmlFrm_ActionUsr[Action],"timeline",NULL,
FuncPars,Timeline,
Btn_REMOVE_BUTTON,Act_GetActionText (TmlFrm_ActionUsr[Action]));
Ale_ShowAlertAndButtonEnd (TmlFrm_ActionUsr[Action],"timeline",NULL,
FuncPars,Timeline,
Btn_REMOVE_BUTTON,Act_GetActionText (TmlFrm_ActionUsr[Action]));
else
Ale_ShowAlertAndButton2 (TmlFrm_ActionGbl[Action],NULL,NULL,
FuncPars,Timeline,
Btn_REMOVE_BUTTON,Act_GetActionText (TmlFrm_ActionGbl[Action]));
Ale_ShowAlertAndButtonEnd (TmlFrm_ActionGbl[Action],NULL,NULL,
FuncPars,Timeline,
Btn_REMOVE_BUTTON,Act_GetActionText (TmlFrm_ActionGbl[Action]));
}

View File

@ -723,19 +723,23 @@ void TmlNot_GetNoteSummary (const struct TmlNot_Note *Not,
case TmlNot_DEG_SHA_PUB_FILE:
case TmlNot_CRS_DOC_PUB_FILE:
case TmlNot_CRS_SHA_PUB_FILE:
Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,Not->Cod,false);
Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,Not->Cod,
Ntf_DONT_GET_CONTENT);
break;
case TmlNot_CALL_FOR_EXAM:
Cfe_GetSummaryAndContentCallForExam (SummaryStr,NULL,Not->Cod,false);
Cfe_GetSummaryAndContentCallForExam (SummaryStr,NULL,Not->Cod,
Ntf_DONT_GET_CONTENT);
break;
case TmlNot_POST:
// Not applicable
break;
case TmlNot_FORUM_POST:
For_GetSummaryAndContentForumPst (SummaryStr,NULL,Not->Cod,false);
For_GetSummaryAndContentForumPst (SummaryStr,NULL,Not->Cod,
Ntf_DONT_GET_CONTENT);
break;
case TmlNot_NOTICE:
Not_GetSummaryAndContentNotice (SummaryStr,NULL,Not->Cod,false);
Not_GetSummaryAndContentNotice (SummaryStr,NULL,Not->Cod,
Ntf_DONT_GET_CONTENT);
break;
}
}
@ -1017,15 +1021,14 @@ static void TmlNot_ReqRemNote (struct Tml_Timeline *Timeline)
NULL,Box_CLOSABLE);
HTM_DIV_Begin ("class=\"Tml_WIDTH\"");
TmlNot_CheckAndWriteNoteWithTopMsg (Timeline,&Not,
Tml_TOP_MESSAGE_NONE,
-1L);
Tml_TOP_MESSAGE_NONE,
-1L);
HTM_DIV_End ();
Box_BoxEnd ();
/* End alert */
Timeline->NotCod = Not.NotCod; // Note to be removed
TmlFrm_EndAlertRemove (Timeline,TmlFrm_REM_NOTE,
TmlNot_PutParsRemoveNote);
TmlFrm_EndAlertRemove (Timeline,TmlFrm_REM_NOTE,TmlNot_PutParsRemoveNote);
}
/*****************************************************************************/

View File

@ -90,7 +90,7 @@ void TmlNtf_CreateNotifToAuthor (long AuthorCod,long PubCod,
void TmlNtf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long PubCod,bool GetContent)
long PubCod,Ntf_GetContent_t GetContent)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
@ -140,7 +140,7 @@ void TmlNtf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
DB_FreeMySQLResult (&mysql_res);
/***** Copy content string *****/
if (GetContent)
if (GetContent == Ntf_GET_CONTENT)
{
Length = strlen (Content.Txt);
if ((*ContentStr = malloc (Length + 1)) != NULL)

View File

@ -38,7 +38,7 @@ void TmlNtf_CreateNotifToAuthor (long AuthorCod,long PubCod,
void TmlNtf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long PubCod,bool GetContent);
long PubCod,Ntf_GetContent_t GetContent);
void TmlNtf_MarkMyNotifAsSeen (void);

View File

@ -1245,7 +1245,7 @@ void Usr_WelcomeUsr (void)
Usr_DB_MarkMyBirthdayAsCongratulated ();
/* Begin alert */
Ale_ShowAlertAndButton1 (Ale_INFO,Txt_Happy_birthday_X,
Ale_ShowAlertAndButtonBegin (Ale_INFO,Txt_Happy_birthday_X,
Gbl.Usrs.Me.UsrDat.FrstName);
/* Show cake icon */
@ -1255,7 +1255,7 @@ void Usr_WelcomeUsr (void)
"class=\"ICO160x160\"");
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,
Ale_ShowAlertAndButtonEnd (ActUnk,NULL,NULL,
NULL,NULL,
Btn_NO_BUTTON,NULL);
}