diff --git a/swad_account.c b/swad_account.c
index 66a0c946..8dcbe19a 100644
--- a/swad_account.c
+++ b/swad_account.c
@@ -145,7 +145,7 @@ static void Acc_ShowFormCheckIfIHaveAccount (const char *Title)
Hlp_PROFILE_SignUp,Box_CLOSABLE);
/***** Help alert *****/
- Ale_ShowA_fmt (Ale_INFO,Txt_If_you_think_you_may_have_been_registered_);
+ Ale_ShowAlert (Ale_INFO,Txt_If_you_think_you_may_have_been_registered_);
/***** Form to request user's ID for possible account already created *****/
Frm_StartForm (ActChkUsrAcc);
@@ -243,7 +243,7 @@ void Acc_CheckIfEmptyAccountExists (void)
Box_EndBoxTable ();
}
else
- Ale_ShowA_fmt (Ale_INFO,Txt_There_is_no_empty_account_associated_with_your_ID_X,
+ Ale_ShowAlert (Ale_INFO,Txt_There_is_no_empty_account_associated_with_your_ID_X,
ID);
/***** Free structure that stores the query result *****/
@@ -255,7 +255,7 @@ void Acc_CheckIfEmptyAccountExists (void)
else // ID not valid
{
/**** Show again form to check if I have an account *****/
- Ale_ShowA_fmt (Ale_WARNING,Txt_Please_enter_your_ID);
+ Ale_ShowAlert (Ale_WARNING,Txt_Please_enter_your_ID);
Acc_ShowFormCheckIfIHaveAccount (Txt_Before_creating_a_new_account_check_if_you_have_been_already_registered);
}
@@ -442,20 +442,17 @@ void Acc_ShowFormChgMyAccount (void)
/***** Check nickname, email and ID *****/
IMustCreateMyPasswordNow = (Gbl.Usrs.Me.UsrDat.Password[0] == '\0');
if (IMustCreateMyPasswordNow)
- Ale_ShowA_fmt (Ale_WARNING,
- Txt_Before_going_to_any_other_option_you_must_create_your_password);
+ Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_create_your_password);
else
{
IMustCreateMyNicknameNow = (Gbl.Usrs.Me.UsrDat.Nickname[0] == '\0');
if (IMustCreateMyNicknameNow)
- Ale_ShowA_fmt (Ale_WARNING,
- Txt_Before_going_to_any_other_option_you_must_fill_your_nickname);
+ Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname);
else
{
IMustFillInMyEmailNow = (Gbl.Usrs.Me.UsrDat.Email[0] == '\0');
if (IMustFillInMyEmailNow)
- Ale_ShowA_fmt (Ale_WARNING,
- Txt_Before_going_to_any_other_option_you_must_fill_in_your_email_address);
+ Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_in_your_email_address);
else
{
IShouldConfirmMyEmailNow = (!Gbl.Usrs.Me.UsrDat.EmailConfirmed && // Email not yet confirmed
@@ -525,10 +522,10 @@ void Acc_ShowFormChgOtherUsrAccount (void)
fprintf (Gbl.F.Out,"");
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
+ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
else // User not found
- Ale_ShowA_fmt (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
+ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
@@ -646,14 +643,14 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
Gbl.Usrs.Me.UsrDat.UsrCod)) // A nickname of another user is the same that this nickname
{
Error = true;
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_nickname_X_had_been_registered_by_another_user,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
}
}
else // New nickname is not valid
{
Error = true;
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_nickname_entered_X_is_not_valid_,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_nickname_entered_X_is_not_valid_,
NewNicknameWithArroba,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
@@ -672,14 +669,14 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
NewEmail)) // An email of another user is the same that my email
{
Error = true;
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_email_address_X_had_been_registered_by_another_user,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
}
}
else // New email is not valid
{
Error = true;
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_email_address_entered_X_is_not_valid,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
}
@@ -689,7 +686,7 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (!Pwd_SlowCheckIfPasswordIsGood (NewPlainPassword,NewEncryptedPassword,-1L)) // New password is good?
{
Error = true;
- Ale_ShowA_new (Ale_WARNING,Gbl.AlertToShowLater.Txt); // Error message is set in Pwd_SlowCheckIfPasswordIsGood
+ Ale_ShowDelayedAlert (); // Error message is set in Pwd_SlowCheckIfPasswordIsGood
}
return !Error;
@@ -834,7 +831,7 @@ void Acc_AfterCreationNewAccount (void)
if (Gbl.Usrs.Me.Logged) // If account has been created without problem, I am logged
{
/***** Show message of success *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
Gbl.Usrs.Me.UsrDat.Nickname,
Cfg_PLATFORM_SHORT_NAME);
@@ -863,7 +860,7 @@ void Acc_GetUsrCodAndRemUsrGbl (void)
Error = true;
if (Error)
- Ale_ShowA_fmt (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
+ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
@@ -973,7 +970,7 @@ static void Acc_AskIfRemoveOtherUsrAccount (void)
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,NULL,Btn_NO_BUTTON,NULL);
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
+ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
@@ -1033,7 +1030,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
UsrDat->FullName);
/***** Remove user as administrator of any degree *****/
@@ -1042,7 +1039,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_THE_USER_X_has_been_removed_as_administrator,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_THE_USER_X_has_been_removed_as_administrator,
UsrDat->FullName);
/***** Remove user's clipboard in forums *****/
@@ -1054,7 +1051,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
/***** Remove the file tree of a user *****/
Acc_RemoveUsrBriefcase (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Briefcase_of_THE_USER_X_has_been_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Briefcase_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
/***** Remove test results made by user in all courses *****/
@@ -1067,7 +1064,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Gbl.Msg.FilterContent[0] = '\0';
Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Messages_of_THE_USER_X_have_been_deleted,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Messages_of_THE_USER_X_have_been_deleted,
UsrDat->FullName);
/***** Remove user from tables of banned users *****/
@@ -1111,13 +1108,13 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
/***** Remove user's photo *****/
PhotoRemoved = Pho_RemovePhoto (UsrDat);
if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Photo_of_THE_USER_X_has_been_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Photo_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
/***** Remove user *****/
Acc_RemoveUsr (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Record_card_of_THE_USER_X_has_been_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Record_card_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
}
diff --git a/swad_agenda.c b/swad_agenda.c
index 76d22632..7427a428 100644
--- a/swad_agenda.c
+++ b/swad_agenda.c
@@ -371,7 +371,7 @@ void Agd_ShowUsrAgenda (void)
}
if (Error)
- Ale_ShowA_fmt (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
+ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
@@ -415,12 +415,12 @@ void Agd_ShowOtherAgendaAfterLogIn (void)
Box_EndBox ();
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
+ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
else
/* The current language is not my preferred language
==> change automatically to my language */
- Ale_ShowA_fmt (Ale_INFO,Txt_Switching_to_LANGUAGE[Gbl.Usrs.Me.UsrDat.Prefs.Language]);
+ Ale_ShowAlert (Ale_INFO,Txt_Switching_to_LANGUAGE[Gbl.Usrs.Me.UsrDat.Prefs.Language]);
}
}
@@ -480,7 +480,7 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType)
Tbl_EndTable ();
}
else
- Ale_ShowA_fmt (Ale_INFO,Txt_No_events);
+ Ale_ShowAlert (Ale_INFO,Txt_No_events);
/***** Write again links to pages *****/
if (Pagination.MoreThanOnePage)
@@ -1311,7 +1311,7 @@ void Agd_RemoveEvent (void)
AgdEvent.AgdCod,AgdEvent.UsrCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_removed,
AgdEvent.Event);
/***** Show events again *****/
@@ -1342,7 +1342,7 @@ void Agd_HideEvent (void)
AgdEvent.AgdCod,AgdEvent.UsrCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_is_now_hidden,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_is_now_hidden,
AgdEvent.Event);
/***** Show events again *****/
@@ -1373,7 +1373,7 @@ void Agd_UnhideEvent (void)
AgdEvent.AgdCod,AgdEvent.UsrCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_is_now_visible,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_is_now_visible,
AgdEvent.Event);
/***** Show events again *****/
@@ -1404,7 +1404,7 @@ void Agd_MakeEventPrivate (void)
AgdEvent.AgdCod,AgdEvent.UsrCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_is_now_private,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_is_now_private,
AgdEvent.Event);
/***** Show events again *****/
@@ -1435,7 +1435,7 @@ void Agd_MakeEventPublic (void)
AgdEvent.AgdCod,AgdEvent.UsrCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_is_now_visible_to_users_of_your_courses,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_is_now_visible_to_users_of_your_courses,
AgdEvent.Event);
/***** Show events again *****/
@@ -1616,14 +1616,14 @@ void Agd_RecFormEvent (void)
if (!AgdEvent.Location[0]) // If there is no event
{
NewEventIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_title_of_the_event);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_title_of_the_event);
}
/***** Check if event is correct *****/
if (!AgdEvent.Event[0]) // If there is no event
{
NewEventIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_title_of_the_event);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_title_of_the_event);
}
/***** Create a new event or update an existing one *****/
@@ -1634,7 +1634,7 @@ void Agd_RecFormEvent (void)
Agd_CreateEvent (&AgdEvent,EventTxt); // Add new event to database
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_event_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_event_X,
AgdEvent.Event);
}
else
@@ -1642,7 +1642,7 @@ void Agd_RecFormEvent (void)
Agd_UpdateEvent (&AgdEvent,EventTxt);
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_event_has_been_modified);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified);
}
/* Free memory for list of selected groups */
diff --git a/swad_alert.c b/swad_alert.c
index 3a025c8f..cce1622f 100644
--- a/swad_alert.c
+++ b/swad_alert.c
@@ -68,6 +68,8 @@ static const char *Ale_AlertIcons[Ale_NUM_ALERT_TYPES] =
/***************************** Private prototypes ****************************/
/*****************************************************************************/
+static void Ale_ShowFixAlert (Ale_AlertType_t AlertType,const char *Txt);
+
/*****************************************************************************/
/******************************** Reset alert ********************************/
/*****************************************************************************/
@@ -99,8 +101,13 @@ void Ale_ShowPendingAlert (void)
/******************** Show an alert message to the user **********************/
/*****************************************************************************/
-void Ale_ShowA_fmt (Ale_AlertType_t AlertType,
- const char *fmt,...)
+void Ale_ShowDelayedAlert (void)
+ {
+ if (Gbl.DelayedAlert.Type != Ale_NONE)
+ Ale_ShowFixAlert (Gbl.DelayedAlert.Type,Gbl.DelayedAlert.Txt);
+ }
+
+void Ale_ShowAlert (Ale_AlertType_t AlertType,const char *fmt,...)
{
va_list ap;
int NumBytesPrinted;
@@ -113,18 +120,17 @@ void Ale_ShowA_fmt (Ale_AlertType_t AlertType,
va_end (ap);
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
- // or some other error occurs,
- // vasprintf will return -1
+ // or some other error occurs,
+ // vasprintf will return -1
Lay_NotEnoughMemoryExit ();
- Ale_ShowAlertAndButton (AlertType,Txt,
- ActUnk,NULL,NULL,NULL,Btn_NO_BUTTON,NULL);
+ Ale_ShowAlert (AlertType,Txt);
free ((void *) Txt);
}
}
-void Ale_ShowA_new (Ale_AlertType_t AlertType,const char *Txt)
+static void Ale_ShowFixAlert (Ale_AlertType_t AlertType,const char *Txt)
{
if (AlertType != Ale_NONE)
Ale_ShowAlertAndButton (AlertType,Txt,
diff --git a/swad_alert.h b/swad_alert.h
index e006cfe5..c3a91f89 100644
--- a/swad_alert.h
+++ b/swad_alert.h
@@ -61,9 +61,8 @@ typedef enum
void Ale_ResetAlert (void);
void Ale_ShowPendingAlert (void);
-void Ale_ShowA_fmt (Ale_AlertType_t AlertType,
- const char *fmt,...);
-void Ale_ShowA_new (Ale_AlertType_t AlertType,const char *Txt);
+void Ale_ShowDelayedAlert (void);
+void Ale_ShowAlert (Ale_AlertType_t AlertType,const char *fmt,...);
void Ale_ShowA_old (Ale_AlertType_t AlertType,const char *Txt);
void Ale_ShowAlertAndButton (Ale_AlertType_t AlertType,const char *Txt,
Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
diff --git a/swad_announcement.c b/swad_announcement.c
index e2b035d8..b8b46063 100644
--- a/swad_announcement.c
+++ b/swad_announcement.c
@@ -131,7 +131,7 @@ void Ann_ShowAllAnnouncements (void)
NULL,
Hlp_MESSAGES_Announcements,Box_NOT_CLOSABLE);
if (!NumAnnouncements)
- Ale_ShowA_fmt (Ale_INFO,Txt_No_announcements);
+ Ale_ShowAlert (Ale_INFO,Txt_No_announcements);
/***** Show the announcements *****/
for (NumAnn = 0;
@@ -495,7 +495,7 @@ void Ann_ReceiveAnnouncement (void)
Ann_CreateAnnouncement (Roles,Subject,Content);
/***** Write message of success *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Announcement_created);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Announcement_created);
/***** Refresh list of announcements *****/
Ann_ShowAllAnnouncements ();
@@ -575,7 +575,7 @@ void Ann_RemoveAnnouncement (void)
AnnCod);
/***** Write message of success *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Announcement_removed);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Announcement_removed);
/***** Refresh list of announcements *****/
Ann_ShowAllAnnouncements ();
diff --git a/swad_assignment.c b/swad_assignment.c
index 02ab5578..ac4b91c7 100644
--- a/swad_assignment.c
+++ b/swad_assignment.c
@@ -167,7 +167,7 @@ static void Asg_ShowAllAssignments (void)
Tbl_EndTable ();
}
else // No assignments created
- Ale_ShowA_fmt (Ale_INFO,Txt_No_assignments);
+ Ale_ShowAlert (Ale_INFO,Txt_No_assignments);
/***** Button to create a new assignment *****/
if (Asg_CheckIfICanCreateAssignments ())
@@ -989,7 +989,7 @@ void Asg_RemoveAssignment (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Assignment_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_removed,
Asg.Title);
/***** Show assignments again *****/
@@ -1019,7 +1019,7 @@ void Asg_HideAssignment (void)
Asg.AsgCod,Gbl.CurrentCrs.Crs.CrsCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Assignment_X_is_now_hidden,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_is_now_hidden,
Asg.Title);
/***** Show assignments again *****/
@@ -1049,7 +1049,7 @@ void Asg_ShowAssignment (void)
Asg.AsgCod,Gbl.CurrentCrs.Crs.CrsCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Assignment_X_is_now_visible,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_is_now_visible,
Asg.Title);
/***** Show assignments again *****/
@@ -1337,7 +1337,7 @@ void Asg_RecFormAssignment (void)
{
NewAssignmentIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_Already_existed_an_assignment_with_the_title_X,
+ Ale_ShowAlert (Ale_WARNING,Txt_Already_existed_an_assignment_with_the_title_X,
NewAsg.Title);
}
else // Title is correct
@@ -1350,14 +1350,14 @@ void Asg_RecFormAssignment (void)
{
NewAssignmentIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_Already_existed_an_assignment_with_the_folder_X,
+ Ale_ShowAlert (Ale_WARNING,Txt_Already_existed_an_assignment_with_the_folder_X,
NewAsg.Folder);
}
}
else // Folder name not valid
{
NewAssignmentIsCorrect = false;
- Ale_ShowA_new (Ale_WARNING,Gbl.AlertToShowLater.Txt);
+ Ale_ShowDelayedAlert (Ale_WARNING,Gbl.DelayedAlert.Txt);
}
}
else // NewAsg.SendWork == Asg_DO_NOT_SEND_WORK
@@ -1367,7 +1367,7 @@ void Asg_RecFormAssignment (void)
if (Brw_CheckIfExistsFolderAssigmentForAnyUsr (OldAsg.Folder))
{
NewAssignmentIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_disable_file_uploading_once_folders_have_been_created);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_disable_file_uploading_once_folders_have_been_created);
}
}
}
@@ -1376,7 +1376,7 @@ void Asg_RecFormAssignment (void)
else // If there is not an assignment title
{
NewAssignmentIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_title_of_the_assignment);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_title_of_the_assignment);
}
/***** Create a new assignment or update an existing one *****/
@@ -1390,7 +1390,7 @@ void Asg_RecFormAssignment (void)
Asg_CreateAssignment (&NewAsg,Description); // Add new assignment to database
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_assignment_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_assignment_X,
NewAsg.Title);
}
else
@@ -1403,7 +1403,7 @@ void Asg_RecFormAssignment (void)
Asg_UpdateAssignment (&NewAsg,Description);
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_assignment_has_been_modified);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_assignment_has_been_modified);
}
}
diff --git a/swad_attendance.c b/swad_attendance.c
index c6cfebc5..cb64b0c0 100644
--- a/swad_attendance.c
+++ b/swad_attendance.c
@@ -276,7 +276,7 @@ static void Att_ShowAllAttEvents (void)
Tbl_EndTable ();
}
else // No events created
- Ale_ShowA_fmt (Ale_INFO,Txt_No_events);
+ Ale_ShowAlert (Ale_INFO,Txt_No_events);
/***** Button to create a new attendance event *****/
if (ICanEdit)
@@ -897,7 +897,7 @@ void Att_AskRemAttEvent (void)
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage);
/* Ask for confirmation of removing */
- Ale_ShowA_fmt (Ale_WARNING,Txt_Do_you_really_want_to_remove_the_event_X,
+ Ale_ShowAlert (Ale_WARNING,Txt_Do_you_really_want_to_remove_the_event_X,
Att.Title);
Btn_PutRemoveButton (Txt_Remove_event);
@@ -928,7 +928,7 @@ void Att_GetAndRemAttEvent (void)
Att_RemoveAttEventFromDB (Att.AttCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_removed,
Att.Title);
/***** Show attendance events again *****/
@@ -974,7 +974,7 @@ void Att_HideAttEvent (void)
Att.AttCod,Gbl.CurrentCrs.Crs.CrsCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_is_now_hidden,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_is_now_hidden,
Att.Title);
/***** Show attendance events again *****/
@@ -1004,7 +1004,7 @@ void Att_ShowAttEvent (void)
Att.AttCod,Gbl.CurrentCrs.Crs.CrsCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Event_X_is_now_visible,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_is_now_visible,
Att.Title);
/***** Show attendance events again *****/
@@ -1290,14 +1290,14 @@ void Att_RecFormAttEvent (void)
{
ReceivedAttEventIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_Already_existed_an_event_with_the_title_X,
+ Ale_ShowAlert (Ale_WARNING,Txt_Already_existed_an_event_with_the_title_X,
ReceivedAtt.Title);
}
}
else // If there is not an attendance event title
{
ReceivedAttEventIsCorrect = false;
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_title_of_the_event);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_title_of_the_event);
}
/***** Create a new attendance event or update an existing one *****/
@@ -1312,7 +1312,7 @@ void Att_RecFormAttEvent (void)
Att_CreateAttEvent (&ReceivedAtt,Description); // Add new attendance event to database
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_event_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_event_X,
ReceivedAtt.Title);
}
else
@@ -1320,7 +1320,7 @@ void Att_RecFormAttEvent (void)
Att_UpdateAttEvent (&ReceivedAtt,Description);
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_event_has_been_modified);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified);
}
/* Free memory for list of selected groups */
@@ -2282,7 +2282,7 @@ void Att_RegisterMeAsStdInAttEvent (void)
Att_RemoveUsrFromAttEvent (Att.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Write final message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Your_comment_has_been_updated);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Your_comment_has_been_updated);
}
/***** Show the attendance event again *****/
@@ -2407,7 +2407,7 @@ void Att_RegisterStudentsInAttEvent (void)
Usr_FreeUsrsList (Rol_STD);
/***** Write final message *****/
- Ale_ShowA_fmt (Ale_INFO,"%s: %u
"
+ Ale_ShowAlert (Ale_INFO,"%s: %u
"
"%s: %u",
Txt_Presents,NumStdsPresent,
Txt_Absents ,NumStdsAbsent );
@@ -2916,7 +2916,7 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView)
}
else // No students selected
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_select_one_ore_more_students);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_students);
Usr_ReqListStdsAttendanceCrs (); // ...show again the form
}
diff --git a/swad_banner.c b/swad_banner.c
index 3d7227c9..7b0602a2 100644
--- a/swad_banner.c
+++ b/swad_banner.c
@@ -111,7 +111,7 @@ void Ban_SeeBanners (void)
if (Gbl.Banners.Num) // There are banners
Ban_WriteListOfBanners ();
else // No banners created
- Ale_ShowA_fmt (Ale_INFO,Txt_No_banners);
+ Ale_ShowAlert (Ale_INFO,Txt_No_banners);
/***** Button to create banner *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
@@ -521,7 +521,7 @@ void Ban_RemoveBanner (void)
Ban.BanCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Banner_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Banner_X_removed,
Ban.ShrtName);
/***** Show the form again *****/
@@ -575,7 +575,7 @@ static void Ban_ShowOrHideBanner (bool Hide)
Ban.BanCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Hide ? Txt_The_banner_X_is_now_hidden :
+ Ale_ShowAlert (Ale_SUCCESS,Hide ? Txt_The_banner_X_is_now_hidden :
Txt_The_banner_X_is_now_visible,
Ban.ShrtName);
@@ -648,7 +648,7 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewBanName[0])
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
CurrentBanName);
else
{
@@ -658,7 +658,7 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
{
/***** If banner was in database... *****/
if (Ban_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_banner_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_banner_X_already_exists,
NewBanName);
else
{
@@ -666,12 +666,12 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
Ban_UpdateBanNameDB (Ban->BanCod,FieldName,NewBanName);
/* Write message to show the change made */
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_banner_X_has_been_renamed_as_Y,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_banner_X_has_been_renamed_as_Y,
CurrentBanName,NewBanName);
}
}
else // The same name
- Ale_ShowA_fmt (Ale_INFO,Txt_The_name_of_the_banner_X_has_not_changed,
+ Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_banner_X_has_not_changed,
CurrentBanName);
}
@@ -739,11 +739,11 @@ void Ban_ChangeBannerImg (void)
NewImg,Ban->BanCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_new_image_is_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_image_is_X,
NewImg);
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_image_empty);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_image_empty);
/***** Show the form again *****/
Str_Copy (Ban->Img,NewImg,
@@ -782,11 +782,11 @@ void Ban_ChangeBannerWWW (void)
NewWWW,Ban->BanCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_new_web_address_is_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_web_address_is_X,
NewWWW);
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
Str_Copy (Ban->WWW,NewWWW,
@@ -926,20 +926,20 @@ void Ban_RecFormNewBanner (void)
{
/***** If name of banner was in database... *****/
if (Ban_CheckIfBannerNameExists ("ShortName",Ban->ShrtName,-1L))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_banner_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_banner_X_already_exists,
Ban->ShrtName);
else if (Ban_CheckIfBannerNameExists ("FullName",Ban->FullName,-1L))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_banner_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_banner_X_already_exists,
Ban->FullName);
else if (!Ban->Img[0])
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_image_of_the_new_banner);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_image_of_the_new_banner);
else if (!Ban->WWW[0])
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_URL_of_the_new_banner);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_URL_of_the_new_banner);
else // Add new banner to database
Ban_CreateBanner (Ban);
}
else // If there is not a banner name
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_banner);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_banner);
/***** Show the form again *****/
Ban_EditBanners ();
@@ -962,7 +962,7 @@ static void Ban_CreateBanner (struct Banner *Ban)
Ban->ShrtName,Ban->FullName,Ban->Img,Ban->WWW);
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_banner_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_banner_X,
Ban->ShrtName);
}
diff --git a/swad_centre.c b/swad_centre.c
index 9222ffe2..a76f20c4 100644
--- a/swad_centre.c
+++ b/swad_centre.c
@@ -225,7 +225,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
Box_EndBoxTable ();
}
else
- Ale_ShowA_fmt (Ale_INFO,Txt_There_are_no_centres_with_requests_for_degrees_to_be_confirmed);
+ Ale_ShowAlert (Ale_INFO,Txt_There_are_no_centres_with_requests_for_degrees_to_be_confirmed);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@@ -816,7 +816,7 @@ static void Ctr_ListCentres (void)
Tbl_EndTable ();
}
else // No centres created in the current institution
- Ale_ShowA_fmt (Ale_INFO,Txt_No_centres);
+ Ale_ShowAlert (Ale_INFO,Txt_No_centres);
/***** Button to create centre *****/
if (Ctr_CheckIfICanCreateCentres ())
@@ -1766,7 +1766,7 @@ void Ctr_RemoveCentre (void)
if (Ctr.Degs.Num ||
Ctr.NumUsrsWhoClaimToBelongToCtr ||
Ctr.NumUsrs) // Centre has degrees or users ==> don't remove
- Ale_ShowA_fmt (Ale_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
+ Ale_ShowAlert (Ale_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
else // Centre has no teachers ==> remove it
{
/***** Remove all the threads and posts in forums of the centre *****/
@@ -1795,7 +1795,7 @@ void Ctr_RemoveCentre (void)
Ctr.CtrCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Centre_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Centre_X_removed,
Ctr.FullName);
}
@@ -1828,8 +1828,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod))
{
- Gbl.AlertToShowLater.Type = Ale_WARNING;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_WARNING;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.ShrtName);
}
@@ -1838,8 +1838,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod))
{
- Gbl.AlertToShowLater.Type = Ale_WARNING;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_WARNING;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.FullName);
}
@@ -1854,8 +1854,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Hie_InitHierarchy ();
/***** Write message to show the change made *****/
- Gbl.AlertToShowLater.Type = Ale_SUCCESS;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_SUCCESS;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName);
}
@@ -1911,8 +1911,8 @@ void Ctr_ChangeCtrPlc (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
- Gbl.AlertToShowLater.Type = Ale_SUCCESS;
- Str_Copy (Gbl.AlertToShowLater.Txt,Txt_The_place_of_the_centre_has_changed,
+ Gbl.DelayedAlert.Type = Ale_SUCCESS;
+ Str_Copy (Gbl.DelayedAlert.Txt,Txt_The_place_of_the_centre_has_changed,
Ale_MAX_BYTES_ALERT);
Ctr_ShowAlertAndButtonToGoToCtr ();
@@ -1933,7 +1933,7 @@ void Ctr_ChangeCtrPlcInConfig (void)
Gbl.CurrentCtr.Ctr.PlcCod = NewPlcCod;
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_place_of_the_centre_has_changed);
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_place_of_the_centre_has_changed);
/***** Show the form again *****/
Ctr_ShowConfiguration ();
@@ -2022,8 +2022,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** Check if new name is empty *****/
if (!NewCtrName[0])
{
- Gbl.AlertToShowLater.Type = Ale_WARNING;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_WARNING;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
CurrentCtrName);
}
@@ -2036,8 +2036,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** If degree was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
{
- Gbl.AlertToShowLater.Type = Ale_WARNING;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_WARNING;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_centre_X_already_exists,NewCtrName);
}
else
@@ -2046,8 +2046,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
Ctr_UpdateInsNameDB (Ctr->CtrCod,FieldName,NewCtrName);
/* Write message to show the change made */
- Gbl.AlertToShowLater.Type = Ale_SUCCESS;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_SUCCESS;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_centre_X_has_been_renamed_as_Y,
CurrentCtrName,NewCtrName);
@@ -2058,8 +2058,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
}
else // The same name
{
- Gbl.AlertToShowLater.Type = Ale_INFO;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_INFO;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_name_of_the_centre_X_has_not_changed,
CurrentCtrName);
}
@@ -2121,14 +2121,14 @@ void Ctr_ChangeCtrWWW (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
- Gbl.AlertToShowLater.Type = Ale_SUCCESS;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.Alert.Txt),
+ Gbl.DelayedAlert.Type = Ale_SUCCESS;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_web_address_is_X,
NewWWW);
Ctr_ShowAlertAndButtonToGoToCtr ();
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
Ctr_EditCentres ();
@@ -2153,11 +2153,11 @@ void Ctr_ChangeCtrWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_new_web_address_is_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_web_address_is_X,
NewWWW);
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
Ctr_ShowConfiguration ();
@@ -2211,8 +2211,8 @@ void Ctr_ChangeCtrStatus (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
- Gbl.AlertToShowLater.Type = Ale_SUCCESS;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.Alert.Txt),
+ Gbl.DelayedAlert.Type = Ale_SUCCESS;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_status_of_the_centre_X_has_changed,
Gbl.Ctrs.EditingCtr.ShrtName);
Ctr_ShowAlertAndButtonToGoToCtr ();
@@ -2259,7 +2259,7 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void)
}
else
/***** Alert *****/
- Ale_ShowA_new (Gbl.AlertToShowLater.Type,Gbl.AlertToShowLater.Txt);
+ Ale_ShowDelayedAlert (Gbl.DelayedAlert.Type,Gbl.DelayedAlert.Txt);
}
static void Ctr_PutParamGoToCtr (void)
@@ -2315,7 +2315,7 @@ void Ctr_RequestPhoto (void)
NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/
- Ale_ShowA_fmt (Ale_INFO,"%s: %s
"
+ Ale_ShowAlert (Ale_INFO,"%s: %s
"
"%s: %u×%u %s",
Txt_Recommended_aspect_ratio,
Ctr_RECOMMENDED_ASPECT_RATIO,
@@ -2374,7 +2374,7 @@ void Ctr_ReceivePhoto (void)
WrongType = true;
if (WrongType)
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_Wrong_file_type);
+ Ale_ShowAlert (Ale_WARNING,Txt_Wrong_file_type);
return;
}
@@ -2394,14 +2394,14 @@ void Ctr_ReceivePhoto (void)
/* Get filename extension */
if ((PtrExtension = strrchr (FileNameImgSrc,(int) '.')) == NULL)
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_Wrong_file_type);
+ Ale_ShowAlert (Ale_WARNING,Txt_Wrong_file_type);
return;
}
LengthExtension = strlen (PtrExtension);
if (LengthExtension < Fil_MIN_BYTES_FILE_EXTENSION ||
LengthExtension > Fil_MAX_BYTES_FILE_EXTENSION)
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_Wrong_file_type);
+ Ale_ShowAlert (Ale_WARNING,Txt_Wrong_file_type);
return;
}
@@ -2412,7 +2412,7 @@ void Ctr_ReceivePhoto (void)
Gbl.UniqueNameEncrypted,PtrExtension);
if (!Fil_EndReceptionOfFile (FileNameImgTmp,Param))
{
- Ale_ShowA_fmt (Ale_WARNING,"Error copying file.");
+ Ale_ShowAlert (Ale_WARNING,"Error copying file.");
return;
}
@@ -2767,7 +2767,7 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
/* Get place */
if ((Gbl.Ctrs.EditingCtr.PlcCod = Plc_GetParamPlcCod ()) < 0) // 0 is reserved for "other place"
- Ale_ShowA_fmt (Ale_ERROR,"Wrong place.");
+ Ale_ShowAlert (Ale_ERROR,"Wrong place.");
/* Get centre short name */
Par_GetParToText ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,Hie_MAX_BYTES_SHRT_NAME);
@@ -2785,19 +2785,19 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
{
/***** If name of centre was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_centre_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.ShrtName);
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Gbl.Ctrs.EditingCtr.FullName,-1L,Gbl.CurrentIns.Ins.InsCod))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_centre_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.FullName);
else // Add new centre to database
Ctr_CreateCentre (Status);
}
else // If there is not a web
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_web_address_of_the_new_centre);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_web_address_of_the_new_centre);
}
else // If there is not a centre name
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre);
/***** Show the form again *****/
Ctr_EditCentres ();
@@ -2831,8 +2831,8 @@ static void Ctr_CreateCentre (unsigned Status)
/***** Write message to show the change made
and put button to go to centre created *****/
- Gbl.AlertToShowLater.Type = Ale_SUCCESS;
- snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
+ Gbl.DelayedAlert.Type = Ale_SUCCESS;
+ snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_Created_new_centre_X,
Gbl.Ctrs.EditingCtr.FullName);
Ctr_ShowAlertAndButtonToGoToCtr ();
diff --git a/swad_changelog.h b/swad_changelog.h
index b6e852bc..a7826949 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -402,10 +402,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
-#define Log_PLATFORM_VERSION "SWAD 18.46.4 (2019-02-16)"
+#define Log_PLATFORM_VERSION "SWAD 18.46.5 (2019-02-16)"
#define CSS_FILE "swad18.41.1.css"
#define JS_FILE "swad18.32.1.js"
/*
+ Version 18.46.5: Feb 16, 2019 Refactoring code related to alerts. (238062 lines)
Version 18.46.4: Feb 16, 2019 Refactoring code related to alerts. (238061 lines)
Version 18.46.3: Feb 16, 2019 Refactoring code related to alerts. (238243 lines)
Version 18.46.2: Feb 16, 2019 Refactoring code related to alerts. (238298 lines)
diff --git a/swad_chat.c b/swad_chat.c
index 31a4cc76..a80edb96 100644
--- a/swad_chat.c
+++ b/swad_chat.c
@@ -82,14 +82,14 @@ void Cht_ShowChatRooms (void)
extern const char *Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_;
/***** Help message about software needed to use the whiteboard/chat *****/
- Ale_ShowA_fmt (Ale_INFO,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
+ Ale_ShowAlert (Ale_INFO,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
Cfg_JAVA_URL,Cfg_JAVA_NAME,
Cfg_PLATFORM_SERVER);
/***** List available chat rooms *****/
Cht_ShowListOfAvailableChatRooms ();
- Ale_ShowA_fmt (Ale_WARNING,Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_);
+ Ale_ShowAlert (Ale_WARNING,Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_);
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
Cht_ShowListOfChatRoomsWithUsrs ();
diff --git a/swad_classroom.c b/swad_classroom.c
index 11eae39e..8bb487d2 100644
--- a/swad_classroom.c
+++ b/swad_classroom.c
@@ -583,7 +583,7 @@ void Cla_RemoveClassroom (void)
Cla->ClaCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Classroom_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Classroom_X_removed,
Cla->FullName);
/***** Show the form again *****/
@@ -668,7 +668,7 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewClaName[0])
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_classroom_X_empty,
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_classroom_X_empty,
CurrentClaName);
else
{
@@ -678,7 +678,7 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName)
{
/***** If classroom was in database... *****/
if (Cla_CheckIfClassroomNameExists (ParamName,NewClaName,Cla->ClaCod))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_classroom_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_classroom_X_already_exists,
NewClaName);
else
{
@@ -686,12 +686,12 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName)
Cla_UpdateClaNameDB (Cla->ClaCod,FieldName,NewClaName);
/* Write message to show the change made */
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_classroom_X_has_been_renamed_as_Y,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_classroom_X_has_been_renamed_as_Y,
CurrentClaName,NewClaName);
}
}
else // The same name
- Ale_ShowA_fmt (Ale_INFO,Txt_The_name_of_the_classroom_X_has_not_changed,
+ Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_classroom_X_has_not_changed,
CurrentClaName);
}
@@ -763,7 +763,7 @@ void Cla_ChangeCapacity (void)
(this happens when return is pressed without changes) *****/
if (Cla->Capacity == NewCapacity)
/***** Message to show no changes made *****/
- Ale_ShowA_fmt (Ale_INFO,Txt_The_capacity_of_classroom_X_has_not_changed,
+ Ale_ShowAlert (Ale_INFO,Txt_The_capacity_of_classroom_X_has_not_changed,
Cla->FullName);
else
{
@@ -775,10 +775,10 @@ void Cla_ChangeCapacity (void)
/***** Message to show the change made *****/
if (NewCapacity > Grp_MAX_STUDENTS_IN_A_GROUP)
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_classroom_X_does_not_have_a_limited_capacity_now,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_classroom_X_does_not_have_a_limited_capacity_now,
Cla->FullName);
else
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_capacity_of_classroom_X_is_now_Y,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_capacity_of_classroom_X_is_now_Y,
Cla->FullName,NewCapacity);
}
@@ -830,11 +830,11 @@ void Cla_ChangeClassroomLocation (void)
Cla_MAX_BYTES_LOCATION);
/* Write message to show the change made */
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_location_of_the_classroom_X_has_changed_to_Y,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_location_of_the_classroom_X_has_changed_to_Y,
Cla->FullName,NewLocation);
}
else // The same location
- Ale_ShowA_fmt (Ale_INFO,Txt_The_location_of_the_classroom_X_has_not_changed,
+ Ale_ShowAlert (Ale_INFO,Txt_The_location_of_the_classroom_X_has_not_changed,
Cla->FullName);
/***** Show the form again *****/
@@ -983,16 +983,16 @@ void Cla_RecFormNewClassroom (void)
{
/***** If name of classroom was in database... *****/
if (Cla_CheckIfClassroomNameExists ("ShortName",Cla->ShrtName,-1L))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_classroom_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_classroom_X_already_exists,
Cla->ShrtName);
else if (Cla_CheckIfClassroomNameExists ("FullName",Cla->FullName,-1L))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_classroom_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_classroom_X_already_exists,
Cla->FullName);
else // Add new classroom to database
Cla_CreateClassroom (Cla);
}
else // If there is not a classroom name
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_classroom);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_classroom);
/***** Show the form again *****/
Cla_EditClassrooms ();
@@ -1016,6 +1016,6 @@ static void Cla_CreateClassroom (struct Classroom *Cla)
Cla->ShrtName,Cla->FullName,Cla->Capacity,Cla->Location);
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_classroom_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_classroom_X,
Cla->FullName);
}
diff --git a/swad_country.c b/swad_country.c
index 98309e7b..0ba890c1 100644
--- a/swad_country.c
+++ b/swad_country.c
@@ -197,7 +197,7 @@ void Cty_SeeCtyWithPendingInss (void)
Box_EndBoxTable ();
}
else
- Ale_ShowA_fmt (Ale_INFO,Txt_There_are_no_countries_with_requests_for_institutions_to_be_confirmed);
+ Ale_ShowAlert (Ale_INFO,Txt_There_are_no_countries_with_requests_for_institutions_to_be_confirmed);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@@ -1740,7 +1740,7 @@ void Cty_RemoveCountry (void)
if (Cty.NumInss ||
Cty.NumUsrsWhoClaimToBelongToCty ||
Cty.NumUsrs) // Country has institutions or users ==> don't remove
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_remove_a_country_with_institutions_or_users);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_remove_a_country_with_institutions_or_users);
else // Country has no users ==> remove it
{
/***** Remove surveys of the country *****/
@@ -1755,7 +1755,7 @@ void Cty_RemoveCountry (void)
Cty_FlushCacheCountryName ();
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Country_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Country_X_removed,
Cty.Name[Gbl.Prefs.Language]);
}
@@ -1795,7 +1795,7 @@ void Cty_RenameCountry (void)
/***** Check if new name is empty *****/
if (!NewCtyName[0])
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
+ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
Cty->Name[Language]);
else
{
@@ -1805,7 +1805,7 @@ void Cty_RenameCountry (void)
{
/***** If country was in database... *****/
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_country_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_country_X_already_exists,
NewCtyName);
else
{
@@ -1816,7 +1816,7 @@ void Cty_RenameCountry (void)
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
/* Write message to show the change made */
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_country_X_has_been_renamed_as_Y,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_country_X_has_been_renamed_as_Y,
Cty->Name[Language],NewCtyName);
/* Update country name */
@@ -1825,7 +1825,7 @@ void Cty_RenameCountry (void)
}
}
else // The same name
- Ale_ShowA_fmt (Ale_INFO,Txt_The_name_of_the_country_X_has_not_changed,
+ Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_country_X_has_not_changed,
Cty->Name[Language]);
}
@@ -1927,7 +1927,7 @@ void Cty_ChangeCtyWWW (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_new_web_address_is_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_web_address_is_X,
NewWWW);
/***** Show the form again *****/
@@ -2131,12 +2131,12 @@ void Cty_RecFormNewCountry (void)
/* Get numeric country code */
if ((Cty->CtyCod = Cty_GetParamOtherCtyCod ()) < 0)
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_numerical_code_of_the_new_country);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_numerical_code_of_the_new_country);
CreateCountry = false;
}
else if (Cty_CheckIfNumericCountryCodeExists (Cty->CtyCod))
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_numerical_code_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_numerical_code_X_already_exists,
Cty->CtyCod);
CreateCountry = false;
}
@@ -2151,7 +2151,7 @@ void Cty_RecFormNewCountry (void)
if (Cty->Alpha2[i] < 'A' ||
Cty->Alpha2[i] > 'Z')
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_alphabetical_code_X_is_not_correct,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_alphabetical_code_X_is_not_correct,
Cty->Alpha2);
CreateCountry = false;
}
@@ -2159,7 +2159,7 @@ void Cty_RecFormNewCountry (void)
{
if (Cty_CheckIfAlpha2CountryCodeExists (Cty->Alpha2))
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_alphabetical_code_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_alphabetical_code_X_already_exists,
Cty->Alpha2);
CreateCountry = false;
}
@@ -2180,7 +2180,7 @@ void Cty_RecFormNewCountry (void)
/***** If name of country was in database... *****/
if (Cty_CheckIfCountryNameExists (Lan,Cty->Name[Lan],-1L))
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_The_country_X_already_exists,
+ Ale_ShowAlert (Ale_WARNING,Txt_The_country_X_already_exists,
Cty->Name[Lan]);
CreateCountry = false;
break;
@@ -2188,7 +2188,7 @@ void Cty_RecFormNewCountry (void)
}
else // If there is not a country name
{
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_name_of_the_new_country_in_all_languages);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_name_of_the_new_country_in_all_languages);
CreateCountry = false;
break;
}
@@ -2271,7 +2271,7 @@ static void Cty_CreateCountry (struct Country *Cty)
Cty->CtyCod,Cty->Alpha2,SubQueryNam2,SubQueryWWW2);
/***** Write success message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_country_X,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_country_X,
Cty->Name);
}
diff --git a/swad_course.c b/swad_course.c
index 9b9a1f5e..e1fc79de 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -1164,7 +1164,7 @@ static void Crs_ListCourses (void)
Tbl_EndTable ();
}
else // No courses created in the current degree
- Ale_ShowA_fmt (Ale_INFO,Txt_No_courses);
+ Ale_ShowAlert (Ale_INFO,Txt_No_courses);
/***** Button to create course *****/
if (Crs_CheckIfICanCreateCourses ())
@@ -1998,19 +1998,19 @@ void Crs_RemoveCourse (void)
{
/***** Check if this course has users *****/
if (Crs.NumUsrs[Rol_UNK]) // Course has users ==> don't remove
- Ale_ShowA_fmt (Ale_WARNING,Txt_To_remove_a_course_you_must_first_remove_all_users_in_the_course);
+ Ale_ShowAlert (Ale_WARNING,Txt_To_remove_a_course_you_must_first_remove_all_users_in_the_course);
else // Course has no users ==> remove it
{
/***** Remove course *****/
Crs_RemoveCourseCompletely (Crs.CrsCod);
/***** Write message to show the change made *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_Course_X_removed,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_Course_X_removed,
Crs.FullName);
}
}
else
- Ale_ShowA_fmt (Ale_WARNING,Txt_You_dont_have_permission_to_edit_this_course);
+ Ale_ShowAlert (Ale_WARNING,Txt_You_dont_have_permission_to_edit_this_course);
/***** Show the form again *****/
Crs_EditCourses ();
@@ -3468,7 +3468,7 @@ void Crs_RemoveOldCrss (void)
SecondsWithoutAccess);
if (NumCrss)
{
- Ale_ShowA_fmt (Ale_INFO,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
+ Ale_ShowAlert (Ale_INFO,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
NumCrss,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
@@ -3489,6 +3489,6 @@ void Crs_RemoveOldCrss (void)
}
/***** Write end message *****/
- Ale_ShowA_fmt (Ale_SUCCESS,Txt_X_courses_have_been_eliminated,
+ Ale_ShowAlert (Ale_SUCCESS,Txt_X_courses_have_been_eliminated,
NumCrssRemoved);
}
diff --git a/swad_database.c b/swad_database.c
index 6e5c6ae6..f678c082 100644
--- a/swad_database.c
+++ b/swad_database.c
@@ -88,7 +88,7 @@ void DB_CreateTablesIfNotExist (void)
extern const char *Txt_Created_tables_in_the_database_that_did_not_exist;
/***** Information message *****/
- Ale_ShowA_fmt (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist);
+ Ale_ShowAlert (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist);
fprintf (Gbl.F.Out,"