From c5cb0e641514715d788e5b54b70ed55adb810673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 10 May 2017 10:25:01 +0200 Subject: [PATCH] Version 16.211 --- swad_ID.c | 34 +++---- swad_account.c | 50 +++++----- swad_agenda.c | 28 +++--- swad_assignment.c | 30 +++--- swad_attendance.c | 28 +++--- swad_banner.c | 44 ++++----- swad_centre.c | 74 +++++++-------- swad_changelog.h | 18 ++-- swad_chat.c | 4 +- swad_country.c | 44 ++++----- swad_course.c | 124 ++++++++++++------------- swad_degree.c | 66 +++++++------- swad_degree_type.c | 36 ++++---- swad_department.c | 48 +++++----- swad_enrolment.c | 216 ++++++++++++++++++++++---------------------- swad_exam.c | 4 +- swad_file.c | 32 +++---- swad_file_browser.c | 192 +++++++++++++++++++-------------------- swad_follow.c | 22 ++--- swad_forum.c | 20 ++-- swad_global.c | 2 +- swad_global.h | 8 +- swad_group.c | 150 +++++++++++++++--------------- swad_help.c | 4 +- swad_holiday.c | 36 ++++---- swad_image.c | 4 +- swad_indicator.c | 4 +- swad_info.c | 8 +- swad_institution.c | 58 ++++++------ swad_layout.c | 38 +++++--- swad_layout.h | 6 +- swad_link.c | 36 ++++---- swad_logo.c | 8 +- swad_mail.c | 70 +++++++------- swad_mark.c | 34 +++---- swad_message.c | 44 ++++----- swad_nickname.c | 14 +-- swad_notice.c | 4 +- swad_notification.c | 4 +- swad_parameter.c | 8 +- swad_password.c | 52 +++++------ swad_photo.c | 42 ++++----- swad_place.c | 32 +++---- swad_plugin.c | 52 +++++------ swad_record.c | 66 +++++++------- swad_session.c | 4 +- swad_statistic.c | 4 +- swad_string.c | 22 ++--- swad_survey.c | 44 ++++----- swad_test.c | 62 ++++++------- swad_test_import.c | 12 +-- swad_user.c | 52 +++++------ swad_xml.c | 12 +-- 53 files changed, 1060 insertions(+), 1050 deletions(-) diff --git a/swad_ID.c b/swad_ID.c index fa8ab9eb..a63e6a5d 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -747,8 +747,8 @@ static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe) ID_RemoveUsrIDFromDB (UsrDat->UsrCod,UsrID); /***** Show message *****/ - sprintf (Gbl.Message,Txt_ID_X_removed,UsrID); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_ID_X_removed,UsrID); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_delete_this_ID); @@ -872,21 +872,21 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe) if (ItsMe || UsrDat->IDs.List[NumIDFound].Confirmed) { Error = true; - sprintf (Gbl.Message,Txt_The_ID_X_matches_one_of_the_existing, + sprintf (Gbl.Alert.Txt,Txt_The_ID_X_matches_one_of_the_existing, NewID); } else // It's not me && !Confirmed { /***** Mark this ID as confirmed *****/ ID_ConfirmUsrID (UsrDat,NewID); - sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed, + sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed, NewID); } } else if (UsrDat->IDs.Num >= ID_MAX_IDS_PER_USER) { Error = true; - sprintf (Gbl.Message,Txt_A_user_can_not_have_more_than_X_IDs, + sprintf (Gbl.Alert.Txt,Txt_A_user_can_not_have_more_than_X_IDs, ID_MAX_IDS_PER_USER); } else // OK ==> add this new ID to my list of IDs @@ -896,20 +896,20 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe) // It's not me ==> ID confirmed ID_InsertANewUsrIDInDB (UsrDat->UsrCod,NewID,!ItsMe); - sprintf (Gbl.Message,Txt_The_ID_X_has_been_registered_successfully, + sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_registered_successfully, NewID); } } else // New ID is not valid { Error = true; - sprintf (Gbl.Message,Txt_The_ID_X_is_not_valid,NewID); + sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,NewID); } /***** Show message *****/ Lay_ShowAlert (Error ? Lay_WARNING : Lay_SUCCESS, - Gbl.Message); + Gbl.Alert.Txt); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); @@ -951,7 +951,7 @@ void ID_ConfirmOtherUsrID (void) unsigned NumIDFound = 0; // Initialized to avoid warning /***** Initialize alert type and message *****/ - Gbl.AlertType = Lay_NONE; // Do not show alert + Gbl.Alert.Type = Lay_NONE; // Do not show alert /***** Get where we came from *****/ OriginalActCod = Par_GetParToLong ("OriginalActCod"); @@ -986,8 +986,8 @@ void ID_ConfirmOtherUsrID (void) if (Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed) { /***** ID found and already confirmed *****/ - Gbl.AlertType = Lay_INFO; - sprintf (Gbl.Message,Txt_ID_X_had_already_been_confirmed, + Gbl.Alert.Type = Lay_INFO; + sprintf (Gbl.Alert.Txt,Txt_ID_X_had_already_been_confirmed, Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID); } else @@ -998,21 +998,21 @@ void ID_ConfirmOtherUsrID (void) Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed = true; /***** Write success message *****/ - Gbl.AlertType = Lay_SUCCESS; - sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed, + Gbl.Alert.Type = Lay_SUCCESS; + sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed, Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID); } } else // User's ID not found { - Gbl.AlertType = Lay_WARNING; - sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_); + Gbl.Alert.Type = Lay_WARNING; + sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_); } } else // I can not confirm { - Gbl.AlertType = Lay_WARNING; - sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_); + Gbl.Alert.Type = Lay_WARNING; + sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_); } /***** Show one or multiple records *****/ diff --git a/swad_account.c b/swad_account.c index cbb1260b..8944cd71 100644 --- a/swad_account.c +++ b/swad_account.c @@ -242,9 +242,9 @@ void Acc_CheckIfEmptyAccountExists (void) } else { - sprintf (Gbl.Message,Txt_There_is_no_empty_account_associated_with_your_ID_X_, + sprintf (Gbl.Alert.Txt,Txt_There_is_no_empty_account_associated_with_your_ID_X_, ID); - Lay_ShowAlert (Lay_INFO,Gbl.Message); + Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt); } /***** Free structure that stores the query result *****/ @@ -633,19 +633,19 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES if (DB_QueryCOUNT (Query,"can not check if nickname already existed")) // A nickname of another user is the same that this nickname { Error = true; - sprintf (Gbl.Message,Txt_The_nickname_X_had_been_registered_by_another_user, + sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user, NewNicknameWithoutArroba); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } } else // New nickname is not valid { Error = true; - sprintf (Gbl.Message,Txt_The_nickname_entered_X_is_not_valid_, + sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_, NewNicknameWithArroba, Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA, Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } /***** Step 2/3: Get new email from form *****/ @@ -661,17 +661,17 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email { Error = true; - sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user, + sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user, NewEmail); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } } else // New email is not valid { Error = true; - sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid, + sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid, NewEmail); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } /***** Step 3/3: Get new password from form *****/ @@ -680,7 +680,7 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES if (!Pwd_SlowCheckIfPasswordIsGood (NewPlainPassword,NewEncryptedPassword,-1L)) // New password is good? { Error = true; - Lay_ShowAlert (Lay_WARNING,Gbl.Message); // Error message is set in Usr_SlowCheckIfPasswordIsGood + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); // Error message is set in Usr_SlowCheckIfPasswordIsGood } return !Error; @@ -814,10 +814,10 @@ void Acc_AfterCreationNewAccount (void) if (Gbl.Usrs.Me.Logged) // If account has been created without problem, I am logged { /***** Show message of success *****/ - sprintf (Gbl.Message,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_, + sprintf (Gbl.Alert.Txt,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_, Gbl.Usrs.Me.UsrDat.Nickname, Cfg_PLATFORM_SHORT_NAME); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show form with account data *****/ Acc_ShowFormChangeMyAccount (); @@ -1005,9 +1005,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat, if (QuietOrVerbose == Cns_VERBOSE) { - sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses, + sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses, UsrDat->FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /***** Remove user as administrator of any degree *****/ @@ -1017,9 +1017,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat, if (QuietOrVerbose == Cns_VERBOSE) { - sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator, + sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator, UsrDat->FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /***** Remove user's clipboard in forums *****/ @@ -1032,9 +1032,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat, Acc_RemoveUsrBriefcase (UsrDat); if (QuietOrVerbose == Cns_VERBOSE) { - sprintf (Gbl.Message,Txt_Briefcase_of_THE_USER_X_has_been_removed, + sprintf (Gbl.Alert.Txt,Txt_Briefcase_of_THE_USER_X_has_been_removed, UsrDat->FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /***** Remove test results made by user in all courses *****/ @@ -1048,9 +1048,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat, Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod); if (QuietOrVerbose == Cns_VERBOSE) { - sprintf (Gbl.Message,Txt_Messages_of_THE_USER_X_have_been_deleted, + sprintf (Gbl.Alert.Txt,Txt_Messages_of_THE_USER_X_have_been_deleted, UsrDat->FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /***** Remove user from tables of banned users *****/ @@ -1095,18 +1095,18 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat, PhotoRemoved = Pho_RemovePhoto (UsrDat); if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE) { - sprintf (Gbl.Message,Txt_Photo_of_THE_USER_X_has_been_removed, + sprintf (Gbl.Alert.Txt,Txt_Photo_of_THE_USER_X_has_been_removed, UsrDat->FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /***** Remove user *****/ Acc_RemoveUsr (UsrDat); if (QuietOrVerbose == Cns_VERBOSE) { - sprintf (Gbl.Message,Txt_Record_card_of_THE_USER_X_has_been_removed, + sprintf (Gbl.Alert.Txt,Txt_Record_card_of_THE_USER_X_has_been_removed, UsrDat->FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } } diff --git a/swad_agenda.c b/swad_agenda.c index 330730f5..4afb0f5e 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -1299,9 +1299,9 @@ void Agd_AskRemEvent (void) /***** Show question and button to remove event *****/ /* Start alert */ - sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_event_X, + sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X, AgdEvent.Event); - Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message); + Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt); /* End alert */ Gbl.Agenda.AgdCodToEdit = AgdEvent.AgdCod; @@ -1337,8 +1337,8 @@ void Agd_RemoveEvent (void) DB_QueryDELETE (Query,"can not remove event"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_removed,AgdEvent.Event); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,AgdEvent.Event); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show events again *****/ Agd_ShowMyAgenda (); @@ -1369,8 +1369,8 @@ void Agd_HideEvent (void) DB_QueryUPDATE (Query,"can not hide event"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_is_now_hidden,AgdEvent.Event); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,AgdEvent.Event); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show events again *****/ Agd_ShowMyAgenda (); @@ -1401,9 +1401,9 @@ void Agd_UnhideEvent (void) DB_QueryUPDATE (Query,"can not show event"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_is_now_visible, + sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible, AgdEvent.Event); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show events again *****/ Agd_ShowMyAgenda (); @@ -1434,8 +1434,8 @@ void Agd_MakeEventPrivate (void) DB_QueryUPDATE (Query,"can not make event private"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_is_now_private,AgdEvent.Event); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_private,AgdEvent.Event); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show events again *****/ Agd_ShowMyAgenda (); @@ -1466,9 +1466,9 @@ void Agd_MakeEventPublic (void) DB_QueryUPDATE (Query,"can not make event public"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_is_now_visible_to_users_of_your_courses, + sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible_to_users_of_your_courses, AgdEvent.Event); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show events again *****/ Agd_ShowMyAgenda (); @@ -1665,8 +1665,8 @@ void Agd_RecFormEvent (void) Agd_CreateEvent (&AgdEvent,Txt); // Add new event to database /***** Write success message *****/ - sprintf (Gbl.Message,Txt_Created_new_event_X,AgdEvent.Event); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,AgdEvent.Event); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else { diff --git a/swad_assignment.c b/swad_assignment.c index d3977380..4c94bcc6 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -970,9 +970,9 @@ void Asg_ReqRemAssignment (void) /***** Show question and button to remove the assignment *****/ /* Start alert */ - sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_assignment_X, + sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_assignment_X, Asg.Title); - Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message); + Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt); /* End alert */ Gbl.Asgs.AsgCodToEdit = Asg.AsgCod; @@ -1017,9 +1017,9 @@ void Asg_RemoveAssignment (void) Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Assignment_X_removed, + sprintf (Gbl.Alert.Txt,Txt_Assignment_X_removed, Asg.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show assignments again *****/ Asg_SeeAssignments (); @@ -1049,9 +1049,9 @@ void Asg_HideAssignment (void) DB_QueryUPDATE (Query,"can not hide assignment"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Assignment_X_is_now_hidden, + sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_hidden, Asg.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show assignments again *****/ Asg_SeeAssignments (); @@ -1081,9 +1081,9 @@ void Asg_ShowAssignment (void) DB_QueryUPDATE (Query,"can not show assignment"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Assignment_X_is_now_visible, + sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_visible, Asg.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show assignments again *****/ Asg_SeeAssignments (); @@ -1362,9 +1362,9 @@ void Asg_RecFormAssignment (void) if (Asg_CheckIfSimilarAssignmentExists ("Title",NewAsg.Title,NewAsg.AsgCod)) { NewAssignmentIsCorrect = false; - sprintf (Gbl.Message,Txt_Already_existed_an_assignment_with_the_title_X, + sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_title_X, NewAsg.Title); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } else // Title is correct { @@ -1375,15 +1375,15 @@ void Asg_RecFormAssignment (void) if (Asg_CheckIfSimilarAssignmentExists ("Folder",NewAsg.Folder,NewAsg.AsgCod)) // If folder of assignment was in database... { NewAssignmentIsCorrect = false; - sprintf (Gbl.Message,Txt_Already_existed_an_assignment_with_the_folder_X, + sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_folder_X, NewAsg.Folder); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } } else // Folder name not valid { NewAssignmentIsCorrect = false; - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } } else // NewAsg.SendWork == Asg_DO_NOT_SEND_WORK @@ -1416,8 +1416,8 @@ void Asg_RecFormAssignment (void) Asg_CreateAssignment (&NewAsg,Txt); // Add new assignment to database /***** Write success message *****/ - sprintf (Gbl.Message,Txt_Created_new_assignment_X,NewAsg.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Created_new_assignment_X,NewAsg.Title); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else { diff --git a/swad_attendance.c b/swad_attendance.c index 6422ea98..e1c446dd 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -877,9 +877,9 @@ void Att_AskRemAttEvent (void) Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage); /***** Ask for confirmation of removing *****/ - sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_event_X, + sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X, Att.Title); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); Lay_PutRemoveButton (Txt_Remove_event); Act_FormEnd (); @@ -908,8 +908,8 @@ void Att_GetAndRemAttEvent (void) Att_RemoveAttEventFromDB (Att.AttCod); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_removed,Att.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,Att.Title); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show attendance events again *****/ Att_SeeAttEvents (); @@ -955,9 +955,9 @@ void Att_HideAttEvent (void) DB_QueryUPDATE (Query,"can not hide attendance event"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_is_now_hidden, + sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden, Att.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show attendance events again *****/ Att_SeeAttEvents (); @@ -987,9 +987,9 @@ void Att_ShowAttEvent (void) DB_QueryUPDATE (Query,"can not show attendance event"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Event_X_is_now_visible, + sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible, Att.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show attendance events again *****/ Att_SeeAttEvents (); @@ -1268,9 +1268,9 @@ void Att_RecFormAttEvent (void) if (Att_CheckIfSimilarAttEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod)) { ReceivedAttEventIsCorrect = false; - sprintf (Gbl.Message,Txt_Already_existed_an_event_with_the_title_X, + sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_event_with_the_title_X, ReceivedAtt.Title); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } } else // If there is not an attendance event title @@ -1291,8 +1291,8 @@ void Att_RecFormAttEvent (void) Att_CreateAttEvent (&ReceivedAtt,Txt); // Add new attendance event to database /***** Write success message *****/ - sprintf (Gbl.Message,Txt_Created_new_event_X,ReceivedAtt.Title); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,ReceivedAtt.Title); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else { @@ -2332,9 +2332,9 @@ void Att_RegisterStudentsInAttEvent (void) /***** Write final message *****/ sprintf (Format,"%s: %%u
%s: %%u",Txt_Presents,Txt_Absents); - sprintf (Gbl.Message,Format, + sprintf (Gbl.Alert.Txt,Format, NumStdsPresent,NumStdsAbsent); - Lay_ShowAlert (Lay_INFO,Gbl.Message); + Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt); } else // Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs == 0 /***** Show warning indicating no students found *****/ diff --git a/swad_banner.c b/swad_banner.c index 3154d578..56ff51ec 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -483,9 +483,9 @@ void Ban_RemoveBanner (void) DB_QueryDELETE (Query,"can not remove a banner"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Banner_X_removed, + sprintf (Gbl.Alert.Txt,Txt_Banner_X_removed, Ban.ShrtName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show the form again *****/ Ban_EditBanners (); @@ -541,10 +541,10 @@ static void Ban_ShowOrHideBanner (bool Hide) } /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Hide ? Txt_The_banner_X_is_now_hidden : + sprintf (Gbl.Alert.Txt,Hide ? Txt_The_banner_X_is_now_hidden : Txt_The_banner_X_is_now_visible, Ban.ShrtName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Show the form again *****/ Ban_EditBanners (); @@ -616,9 +616,9 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName) /***** Check if new name is empty *****/ if (!NewBanName[0]) { - sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_banner_X_empty, + sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_banner_X_empty, CurrentBanName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } else { @@ -628,9 +628,9 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName) /***** If banner was in database... *****/ if (Ban_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod)) { - sprintf (Gbl.Message,Txt_The_banner_X_already_exists, + sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists, NewBanName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } else { @@ -638,16 +638,16 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName) Ban_UpdateBanNameDB (Ban->BanCod,FieldName,NewBanName); /* Write message to show the change made */ - sprintf (Gbl.Message,Txt_The_banner_X_has_been_renamed_as_Y, + sprintf (Gbl.Alert.Txt,Txt_The_banner_X_has_been_renamed_as_Y, CurrentBanName,NewBanName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } } else // The same name { - sprintf (Gbl.Message,Txt_The_name_of_the_banner_X_has_not_changed, + sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_banner_X_has_not_changed, CurrentBanName); - Lay_ShowAlert (Lay_INFO,Gbl.Message); + Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt); } } @@ -717,9 +717,9 @@ void Ban_ChangeBannerImg (void) DB_QueryUPDATE (Query,"can not update the image of a banner"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_new_image_is_X, + sprintf (Gbl.Alert.Txt,Txt_The_new_image_is_X, NewImg); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_image_empty); @@ -762,9 +762,9 @@ void Ban_ChangeBannerWWW (void) DB_QueryUPDATE (Query,"can not update the web of a banner"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_new_web_address_is_X, + sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X, NewWWW); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty); @@ -908,15 +908,15 @@ void Ban_RecFormNewBanner (void) /***** If name of banner was in database... *****/ if (Ban_CheckIfBannerNameExists ("ShortName",Ban->ShrtName,-1L)) { - sprintf (Gbl.Message,Txt_The_banner_X_already_exists, + sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists, Ban->ShrtName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } else if (Ban_CheckIfBannerNameExists ("FullName",Ban->FullName,-1L)) { - sprintf (Gbl.Message,Txt_The_banner_X_already_exists, + sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists, Ban->FullName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); } else if (!Ban->Img[0]) Lay_ShowAlert (Lay_WARNING,Txt_You_must_specify_the_image_of_the_new_banner); @@ -950,9 +950,9 @@ static void Ban_CreateBanner (struct Banner *Ban) DB_QueryINSERT (Query,"can not create banner"); /***** Write success message *****/ - sprintf (Gbl.Message,Txt_Created_new_banner_X, + sprintf (Gbl.Alert.Txt,Txt_Created_new_banner_X, Ban->ShrtName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /*****************************************************************************/ diff --git a/swad_centre.c b/swad_centre.c index c622dbdb..ea08b31a 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1741,9 +1741,9 @@ void Ctr_RemoveCentre (void) DB_QueryDELETE (Query,"can not remove a centre"); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_Centre_X_removed, + sprintf (Gbl.Alert.Txt,Txt_Centre_X_removed, Ctr.FullName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } /***** Show the form again *****/ @@ -1775,8 +1775,8 @@ void Ctr_ChangeCtrInsInConfig (void) Gbl.CurrentCtr.Ctr.CtrCod, NewIns.InsCod)) { - Gbl.AlertType = Lay_WARNING; - sprintf (Gbl.Message,Txt_The_centre_X_already_exists, + Gbl.Alert.Type = Lay_WARNING; + sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, Gbl.CurrentCtr.Ctr.ShrtName); } else if (Ctr_CheckIfCtrNameExistsInIns ("FullName", @@ -1784,8 +1784,8 @@ void Ctr_ChangeCtrInsInConfig (void) Gbl.CurrentCtr.Ctr.CtrCod, NewIns.InsCod)) { - Gbl.AlertType = Lay_WARNING; - sprintf (Gbl.Message,Txt_The_centre_X_already_exists, + Gbl.Alert.Type = Lay_WARNING; + sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, Gbl.CurrentCtr.Ctr.FullName); } else @@ -1799,8 +1799,8 @@ void Ctr_ChangeCtrInsInConfig (void) Hie_InitHierarchy (); /***** Write message to show the change made *****/ - Gbl.AlertType = Lay_SUCCESS; - sprintf (Gbl.Message,Txt_The_centre_X_has_been_moved_to_the_institution_Y, + Gbl.Alert.Type = Lay_SUCCESS; + sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_moved_to_the_institution_Y, Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName); } } @@ -1944,8 +1944,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull /***** Check if new name is empty *****/ if (!NewCtrName[0]) { - Gbl.AlertType = Lay_WARNING; - sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_centre_X_empty, + Gbl.Alert.Type = Lay_WARNING; + sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_centre_X_empty, CurrentCtrName); } else @@ -1956,8 +1956,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.AlertType = Lay_WARNING; - sprintf (Gbl.Message,Txt_The_centre_X_already_exists,NewCtrName); + Gbl.Alert.Type = Lay_WARNING; + sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,NewCtrName); } else { @@ -1965,8 +1965,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.AlertType = Lay_SUCCESS; - sprintf (Gbl.Message,Txt_The_centre_X_has_been_renamed_as_Y, + Gbl.Alert.Type = Lay_SUCCESS; + sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_renamed_as_Y, CurrentCtrName,NewCtrName); /* Change current centre name in order to display it properly */ @@ -1976,8 +1976,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull } else // The same name { - Gbl.AlertType = Lay_INFO; - sprintf (Gbl.Message,Txt_The_name_of_the_centre_X_has_not_changed, + Gbl.Alert.Type = Lay_INFO; + sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_centre_X_has_not_changed, CurrentCtrName); } } @@ -2045,8 +2045,8 @@ void Ctr_ChangeCtrWWW (void) Cns_MAX_BYTES_WWW); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Put button to go to centre changed *****/ Ctr_PutButtonToGoToCtr (Ctr); @@ -2077,8 +2077,8 @@ void Ctr_ChangeCtrWWWInConfig (void) Cns_MAX_BYTES_WWW); /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); } else Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty); @@ -2142,9 +2142,9 @@ void Ctr_ChangeCtrStatus (void) Ctr->Status = Status; /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_status_of_the_centre_X_has_changed, + sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_centre_X_has_changed, Ctr->ShrtName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); + Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt); /***** Put button to go to centre changed *****/ Ctr_PutButtonToGoToCtr (Ctr); @@ -2162,7 +2162,7 @@ void Ctr_ContEditAfterChgCtr (void) /***** Write success / warning message *****/ Lay_ShowPendingAlert (); - if (Gbl.AlertType == Lay_SUCCESS) + if (Gbl.Alert.Type == Lay_SUCCESS) /***** Put button to go to centre changed *****/ Ctr_PutButtonToGoToCtr (&Gbl.Ctrs.EditingCtr); @@ -2238,7 +2238,7 @@ void Ctr_RequestPhoto (void) Lay_StartRoundFrame (NULL,Txt_Photo,NULL,NULL); /***** Write help message *****/ - sprintf (Gbl.Message,"%s: %s
" + sprintf (Gbl.Alert.Txt,"%s: %s
" "%s: %u×%u %s", Txt_Recommended_aspect_ratio, Ctr_RECOMMENDED_ASPECT_RATIO, @@ -2246,7 +2246,7 @@ void Ctr_RequestPhoto (void) Ctr_PHOTO_SAVED_MAX_WIDTH, Ctr_PHOTO_SAVED_MAX_HEIGHT, Txt_XxY_pixels_or_higher); - Lay_ShowAlert (Lay_INFO,Gbl.Message); + Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt); /***** Upload photo *****/ fprintf (Gbl.F.Out,"