diff --git a/swad_changelog.h b/swad_changelog.h index 160d2b7af..9538ec7e6 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -384,6 +384,7 @@ OPTIMIZE TABLE debug; // TODO: Revisar todos los Ale_ShowAlertAndButton // TODO: Pasar a una función Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); +// TODO: Pasar a una función Ale_ShowAlert (Ale_ERROR,"You don't have permission to edit this project."); /*****************************************************************************/ /****************************** Public constants *****************************/ @@ -404,10 +405,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.46.8 (2019-02-16)" +#define Log_PLATFORM_VERSION "SWAD 18.46.9 (2019-02-16)" #define CSS_FILE "swad18.41.1.css" #define JS_FILE "swad18.32.1.js" /* + Version 18.46.9: Feb 16, 2019 Refactoring code related to alerts. (237809 lines) Version 18.46.8: Feb 16, 2019 Refactoring code related to alerts. (237863 lines) Version 18.46.7: Feb 16, 2019 Refactoring code related to alerts. (237953 lines) Version 18.46.6: Feb 16, 2019 Refactoring code related to alerts. (238019 lines) diff --git a/swad_project.c b/swad_project.c index b1fffae62..6a55777d8 100644 --- a/swad_project.c +++ b/swad_project.c @@ -235,7 +235,7 @@ void Prj_ShowTableAllProjects (void) Prj_FreeMemProject (&Prj); } else // No projects created - Ale_ShowA_old (Ale_INFO,Txt_No_projects); + Ale_ShowAlert (Ale_INFO,Txt_No_projects); } /*****************************************************************************/ @@ -335,7 +335,7 @@ static void Prj_ShowProjectsInCurrentPage (void) &Pagination); } else // No projects created - Ale_ShowA_old (Ale_INFO,Txt_No_projects); + Ale_ShowAlert (Ale_INFO,Txt_No_projects); /***** Button to create a new project *****/ if (Prj_CheckIfICanCreateProjects ()) @@ -1963,18 +1963,16 @@ static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject) Prj_FlushCacheMyRoleInProject (); /* Show success alert */ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_THE_USER_X_has_been_enroled_as_a_Y_in_the_project, - Gbl.Usrs.Other.UsrDat.FullName, - Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject]); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_THE_USER_X_has_been_enroled_as_a_Y_in_the_project, + Gbl.Usrs.Other.UsrDat.FullName, + Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject]); } /***** Free list of users' codes *****/ Usr_FreeListUsrCods (&ListUsrCods); } else // No users found - Ale_ShowA_old (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_); /***** Put form to edit project again *****/ Prj_RequestCreatOrEditPrj (PrjCod); @@ -2059,10 +2057,10 @@ static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject) Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,NULL,Btn_NO_BUTTON,NULL); } else - Ale_ShowA_old (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 - Ale_ShowA_old (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_); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); @@ -2129,18 +2127,16 @@ static void Prj_RemUsrFromPrj (Prj_RoleInProject_t RoleInProject) Prj_FlushCacheMyRoleInProject (); /***** Show success alert *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_THE_USER_X_has_been_removed_as_a_Y_from_the_project_Z, - Gbl.Usrs.Other.UsrDat.FullName, - Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject], - Prj.Title); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_THE_USER_X_has_been_removed_as_a_Y_from_the_project_Z, + Gbl.Usrs.Other.UsrDat.FullName, + Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject], + Prj.Title); } else - Ale_ShowA_old (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 - Ale_ShowA_old (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_); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); @@ -2692,7 +2688,7 @@ void Prj_ReqRemProject (void) Btn_REMOVE_BUTTON,Txt_Remove_project); } else - Ale_ShowA_old (Ale_ERROR,"You don't have permission to edit this project."); + Ale_ShowAlert (Ale_ERROR,"You don't have permission to edit this project."); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); @@ -2751,13 +2747,11 @@ void Prj_RemoveProject (void) Fil_RemoveTree (PathRelPrj); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_Project_X_removed, - Prj.Title); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_Project_X_removed, + Prj.Title); } else - Ale_ShowA_old (Ale_ERROR,"You don't have permission to edit this project."); + Ale_ShowAlert (Ale_ERROR,"You don't have permission to edit this project."); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); @@ -2795,13 +2789,11 @@ void Prj_HideProject (void) Prj.PrjCod,Gbl.CurrentCrs.Crs.CrsCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_Project_X_is_now_hidden, - Prj.Title); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_Project_X_is_now_hidden, + Prj.Title); } else - Ale_ShowA_old (Ale_ERROR,"You don't have permission to edit this project."); + Ale_ShowAlert (Ale_ERROR,"You don't have permission to edit this project."); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); @@ -2839,13 +2831,11 @@ void Prj_ShowProject (void) Prj.PrjCod,Gbl.CurrentCrs.Crs.CrsCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_Project_X_is_now_visible, - Prj.Title); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_Project_X_is_now_visible, + Prj.Title); } else - Ale_ShowA_old (Ale_ERROR,"You don't have permission to edit this project."); + Ale_ShowAlert (Ale_ERROR,"You don't have permission to edit this project."); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); @@ -3248,7 +3238,7 @@ void Prj_RecFormProject (void) if (!Prj.Title[0]) // If there is not a project title { NewProjectIsCorrect = false; - Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_title_of_the_project); + Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_title_of_the_project); } /***** Create a new project or update an existing one *****/ @@ -3260,10 +3250,8 @@ void Prj_RecFormProject (void) Prj_CreateProject (&Prj); // Add new project to database /* Write success message */ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_Created_new_project_X, - Prj.Title); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_project_X, + Prj.Title); } else if (NewProjectIsCorrect) { @@ -3271,7 +3259,7 @@ void Prj_RecFormProject (void) Prj_UpdateProject (&Prj); /* Write success message */ - Ale_ShowA_old (Ale_SUCCESS,Txt_The_project_has_been_modified); + Ale_ShowAlert (Ale_SUCCESS,Txt_The_project_has_been_modified); } } else @@ -3281,7 +3269,7 @@ void Prj_RecFormProject (void) Prj_RequestCreatOrEditPrj (Prj.PrjCod); } else - Ale_ShowA_old (Ale_ERROR,"You don't have permission to edit this project."); + Ale_ShowAlert (Ale_ERROR,"You don't have permission to edit this project."); /***** Free memory of the project *****/ Prj_FreeMemProject (&Prj); diff --git a/swad_record.c b/swad_record.c index cc040f812..b6c808287 100644 --- a/swad_record.c +++ b/swad_record.c @@ -206,12 +206,8 @@ void Rec_ReqEditRecordFields (void) Box_EndBoxTable (); } else // No fields of records found for current course in the database - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_There_are_no_record_fields_in_the_course_X, - Gbl.CurrentCrs.Crs.FullName); - Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_INFO,Txt_There_are_no_record_fields_in_the_course_X, + Gbl.CurrentCrs.Crs.FullName); /***** Put a form to create a new record field *****/ Rec_ShowFormCreateRecordField (); @@ -488,17 +484,13 @@ void Rec_ReceiveFormField (void) { /***** If the field already was in the database... *****/ if (Rec_CheckIfRecordFieldIsRepeated (Gbl.CurrentCrs.Records.Field.Name)) - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_record_field_X_already_exists, - Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_ERROR,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_ERROR,Txt_The_record_field_X_already_exists, + Gbl.CurrentCrs.Records.Field.Name); else // Add the new field to the database Rec_CreateRecordField (); } else // If there is not name - Ale_ShowA_old (Ale_ERROR,Txt_You_must_specify_the_name_of_the_new_record_field); + Ale_ShowAlert (Ale_ERROR,Txt_You_must_specify_the_name_of_the_new_record_field); /***** Show the form again *****/ Rec_ReqEditRecordFields (); @@ -594,7 +586,7 @@ void Rec_CreateRecordField (void) snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Txt_Created_new_record_field_X, Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); } /*****************************************************************************/ @@ -707,10 +699,8 @@ void Rec_RemoveFieldFromDB (void) Gbl.CurrentCrs.Records.Field.FieldCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_Record_field_X_removed, - Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_Record_field_X_removed, + Gbl.CurrentCrs.Records.Field.Name); /***** Show the form again *****/ Rec_ReqEditRecordFields (); @@ -813,12 +803,8 @@ void Rec_RenameField (void) /***** Check if new name is empty *****/ if (!NewFieldName[0]) - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_You_can_not_leave_the_name_of_the_field_X_empty, - Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_ERROR,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_ERROR,Txt_You_can_not_leave_the_name_of_the_field_X_empty, + Gbl.CurrentCrs.Records.Field.Name); else { /***** Check if the name of the olde field match the new one @@ -827,12 +813,8 @@ void Rec_RenameField (void) { /***** If the group ya estaba in the database... *****/ if (Rec_CheckIfRecordFieldIsRepeated (NewFieldName)) - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_record_field_X_already_exists, - NewFieldName); - Ale_ShowA_old (Ale_ERROR,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_ERROR,Txt_The_record_field_X_already_exists, + NewFieldName); else { /* Update the table of fields changing then old name by the new one */ @@ -842,19 +824,13 @@ void Rec_RenameField (void) NewFieldName,Gbl.CurrentCrs.Records.Field.FieldCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_record_field_X_has_been_renamed_as_Y, - Gbl.CurrentCrs.Records.Field.Name,NewFieldName); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_The_record_field_X_has_been_renamed_as_Y, + Gbl.CurrentCrs.Records.Field.Name,NewFieldName); } } else // The same name - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_name_of_the_field_X_has_not_changed, - NewFieldName); - Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_field_X_has_not_changed, + NewFieldName); } /***** Show the form again *****/ @@ -891,12 +867,8 @@ void Rec_ChangeLinesField (void) /***** Check if the old number of rows matches the new one (this happens when return is pressed without changes) *****/ if (Gbl.CurrentCrs.Records.Field.NumLines == NewNumLines) - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed, - Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_INFO,Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed, + Gbl.CurrentCrs.Records.Field.Name); else { /***** Update of the table of fields changing the old maximum of students by the new one *****/ @@ -906,10 +878,8 @@ void Rec_ChangeLinesField (void) NewNumLines,Gbl.CurrentCrs.Records.Field.FieldCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y, - Gbl.CurrentCrs.Records.Field.Name,NewNumLines); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y, + Gbl.CurrentCrs.Records.Field.Name,NewNumLines); } /***** Show the form again *****/ @@ -945,12 +915,8 @@ void Rec_ChangeVisibilityField (void) /***** Check if the old visibility matches the new one (this happens when return is pressed without changes) *****/ if (Gbl.CurrentCrs.Records.Field.Visibility == NewVisibility) - { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_visibility_of_the_record_field_X_has_not_changed, - Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt); - } + Ale_ShowAlert (Ale_INFO,Txt_The_visibility_of_the_record_field_X_has_not_changed, + Gbl.CurrentCrs.Records.Field.Name); else { /***** Update of the table of fields changing the old visibility by the new *****/ @@ -961,10 +927,8 @@ void Rec_ChangeVisibilityField (void) Gbl.CurrentCrs.Records.Field.FieldCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility], - Gbl.CurrentCrs.Records.Field.Name); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowAlert (Ale_SUCCESS,Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility], + Gbl.CurrentCrs.Records.Field.Name); } /***** Show the form again *****/ @@ -1038,7 +1002,7 @@ static void Rec_ListRecordsGsts (Rec_SharedRecordViewType_t TypeOfView) /* Check the number of students to show */ if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If no students selected... { // ...write warning notice - Ale_ShowA_old (Ale_WARNING,Txt_You_must_select_one_ore_more_users); + Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users); Usr_SeeGuests (); // ...show again the form return; } @@ -1236,7 +1200,7 @@ static void Rec_ListRecordsStds (Rec_SharedRecordViewType_t ShaTypeOfView, /* Check the number of students to show */ if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If no students selected... { // ...write warning notice - Ale_ShowA_old (Ale_WARNING,Txt_You_must_select_one_ore_more_students); + Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_students); Usr_SeeStudents (); // ...show again the form return; } @@ -1460,7 +1424,7 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView) /* Check the number of teachers to show */ if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If no teachers selected... { // ...write warning notice - Ale_ShowA_old (Ale_WARNING,Txt_You_must_select_one_ore_more_teachers); + Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_teachers); Usr_SeeTeachers (); // ...show again the form return; } @@ -2062,8 +2026,8 @@ static void Rec_ShowMyCrsRecordUpdated (void) { extern const char *Txt_Your_record_card_in_this_course_has_been_updated; - /***** Write mensaje of success *****/ - Ale_ShowA_old (Ale_SUCCESS,Txt_Your_record_card_in_this_course_has_been_updated); + /***** Write success message *****/ + Ale_ShowAlert (Ale_SUCCESS,Txt_Your_record_card_in_this_course_has_been_updated); /***** Shared record *****/ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Me.UsrDat,NULL); @@ -2157,7 +2121,7 @@ void Rec_ShowMySharedRecordUpd (void) extern const char *Txt_Your_personal_data_have_been_updated; /***** Write alert *****/ - Ale_ShowA_old (Ale_SUCCESS,Txt_Your_personal_data_have_been_updated); + Ale_ShowAlert (Ale_SUCCESS,Txt_Your_personal_data_have_been_updated); /***** Show my record and other data *****/ Rec_ShowMySharedRecordAndMore (); @@ -3964,28 +3928,21 @@ void Rec_ShowMySharedRecordAndMore (void) /***** If user has no name and surname, sex... *****/ if (!Gbl.Usrs.Me.UsrDat.FirstName[0] || !Gbl.Usrs.Me.UsrDat.Surname1[0]) // 1. No name - Ale_ShowA_old (Ale_WARNING, - Txt_Please_fill_in_your_record_card_including_your_name); + Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_record_card_including_your_name); else if (Gbl.Usrs.Me.UsrDat.Sex == Usr_SEX_UNKNOWN) // 2. No sex - Ale_ShowA_old (Ale_WARNING, - Txt_Please_fill_in_your_record_card_including_your_sex); + Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_record_card_including_your_sex); else if (Gbl.Usrs.Me.UsrDat.CtyCod < 0) // 3. No country - Ale_ShowA_old (Ale_WARNING, - Txt_Please_fill_in_your_record_card_including_your_country_nationality); + Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_record_card_including_your_country_nationality); else if (Gbl.Usrs.Me.UsrDat.InsCtyCod < 0) // 4. No institution country - Ale_ShowA_old (Ale_WARNING, - Txt_Please_select_the_country_of_your_institution); + Ale_ShowAlert (Ale_WARNING,Txt_Please_select_the_country_of_your_institution); else if (Gbl.Usrs.Me.UsrDat.InsCod < 0) // 5. No institution - Ale_ShowA_old (Ale_WARNING, - Txt_Please_fill_in_your_institution); + Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_institution); else if (IAmATeacher) { if (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0) // 6. No centre - Ale_ShowA_old (Ale_WARNING, - Txt_Please_fill_in_your_centre); + Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_centre); else if (Gbl.Usrs.Me.UsrDat.Tch.DptCod < 0) // 7. No deparment - Ale_ShowA_old (Ale_WARNING, - Txt_Please_fill_in_your_department); + Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_department); } /***** Start container *****/ diff --git a/swad_search.c b/swad_search.c index 640f334cb..52bf0bb55 100644 --- a/swad_search.c +++ b/swad_search.c @@ -440,7 +440,7 @@ static void Sch_SearchInDB (void) } if (NumResults == 0) - Ale_ShowA_old (Ale_INFO,Txt_No_results); + Ale_ShowAlert (Ale_INFO,Txt_No_results); } /*****************************************************************************/ @@ -653,7 +653,7 @@ static unsigned Sch_SearchUsrsInDB (Rol_Role_t Role) // Too short if (!WarningMessageWritten) // To avoid repetitions { - Ale_ShowA_old (Ale_WARNING,Txt_The_search_text_must_be_longer); + Ale_ShowAlert (Ale_WARNING,Txt_The_search_text_must_be_longer); WarningMessageWritten = true; } diff --git a/swad_social.c b/swad_social.c index 93ff00baa..44e730de0 100644 --- a/swad_social.c +++ b/swad_social.c @@ -1125,7 +1125,7 @@ static void Soc_ShowWarningYouDontFollowAnyUser (void) if (!Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod)) { /***** Show warning if I do not follow anyone *****/ - Ale_ShowA_old (Ale_WARNING,Txt_You_dont_follow_any_user); + Ale_ShowAlert (Ale_WARNING,Txt_You_dont_follow_any_user); /***** Put link to show users to follow *****/ fprintf (Gbl.F.Out,"
"); @@ -1331,7 +1331,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, if (SocNot->NotCod <= 0 || SocNot->NoteType == Soc_NOTE_UNKNOWN || SocNot->UsrCod <= 0) - Ale_ShowA_old (Ale_ERROR,"Error in social note."); + Ale_ShowAlert (Ale_ERROR,"Error in social note."); else { /***** Initialize location in hierarchy *****/ @@ -2571,7 +2571,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom, if (SocCom->PubCod <= 0 || SocCom->NotCod <= 0 || SocCom->UsrCod <= 0) - Ale_ShowA_old (Ale_ERROR,"Error in social comment."); + Ale_ShowAlert (Ale_ERROR,"Error in social comment."); else { /***** Get author's data *****/ @@ -3004,7 +3004,7 @@ static long Soc_ReceiveComment (void) Img_ImageDestructor (&Image); } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); return SocNot.NotCod; } @@ -3083,7 +3083,7 @@ static long Soc_ShareSocialNote (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); return SocNot.NotCod; } @@ -3169,7 +3169,7 @@ static long Soc_FavSocialNote (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); return SocNot.NotCod; } @@ -3255,7 +3255,7 @@ static long Soc_FavSocialComment (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_comment_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_comment_no_longer_exists); /***** Free image *****/ Img_ImageDestructor (&SocCom.Image); @@ -3381,7 +3381,7 @@ static long Soc_UnshareSocialNote (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); return SocNot.NotCod; } @@ -3465,7 +3465,7 @@ static long Soc_UnfavSocialNote (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); return SocNot.NotCod; } @@ -3549,7 +3549,7 @@ static long Soc_UnfavSocialComment (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_comment_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_comment_no_longer_exists); /***** Free image *****/ Img_ImageDestructor (&SocCom.Image); @@ -3630,7 +3630,7 @@ static void Soc_RequestRemovalSocialNote (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); } /*****************************************************************************/ @@ -3704,11 +3704,11 @@ static void Soc_RemoveSocialNote (void) Soc_RemoveASocialNoteFromDB (&SocNot); /***** Message of success *****/ - Ale_ShowA_old (Ale_SUCCESS,Txt_Post_removed); + Ale_ShowAlert (Ale_SUCCESS,Txt_Post_removed); } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_original_post_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_original_post_no_longer_exists); } /*****************************************************************************/ @@ -3964,7 +3964,7 @@ static void Soc_RequestRemovalSocialComment (void) } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_comment_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_comment_no_longer_exists); /***** Free image *****/ Img_ImageDestructor (&SocCom.Image); @@ -4043,11 +4043,11 @@ static void Soc_RemoveSocialComment (void) Soc_RemoveASocialCommentFromDB (&SocCom); /***** Message of success *****/ - Ale_ShowA_old (Ale_SUCCESS,Txt_Comment_removed); + Ale_ShowAlert (Ale_SUCCESS,Txt_Comment_removed); } } else - Ale_ShowA_old (Ale_WARNING,Txt_The_comment_no_longer_exists); + Ale_ShowAlert (Ale_WARNING,Txt_The_comment_no_longer_exists); /***** Free image *****/ Img_ImageDestructor (&SocCom.Image); diff --git a/swad_statistic.c b/swad_statistic.c index ca68c90fa..a69f1fbb9 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -478,7 +478,7 @@ void Sta_AskShowCrsHits (void) } } else // No teachers nor students found - Ale_ShowA_old (Ale_WARNING,Txt_No_teachers_or_students_found); + Ale_ShowAlert (Ale_WARNING,Txt_No_teachers_or_students_found); /***** End section with user list *****/ Lay_EndSection (); @@ -861,7 +861,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) Gbl.Stat.CountType == Sta_CLICKS_PER_USR)) // These types of query will never give a valid result { /* Write warning message and abort */ - Ale_ShowA_old (Ale_WARNING,Txt_There_is_no_knowing_how_many_users_not_logged_have_accessed); + Ale_ShowAlert (Ale_WARNING,Txt_There_is_no_knowing_how_many_users_not_logged_have_accessed); return; } break; @@ -900,7 +900,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // Error: there are no users selected { /* Write warning message, clean and abort */ - Ale_ShowA_old (Ale_WARNING,Txt_You_must_select_one_ore_more_users); + Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users); Usr_FreeListsSelectedUsrsCods (); return; } @@ -910,23 +910,22 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) /***** Check if range of dates is forbidden for me *****/ NumDays = Dat_GetNumDaysBetweenDates (&Gbl.DateRange.DateIni.Date,&Gbl.DateRange.DateEnd.Date); ICanQueryWholeRange = (Gbl.Usrs.Me.Role.Logged >= Rol_TCH && GlobalOrCourse == Sta_SHOW_COURSE_ACCESSES) || - (Gbl.Usrs.Me.Role.Logged == Rol_TCH && Gbl.Scope.Current == Sco_SCOPE_CRS) || + (Gbl.Usrs.Me.Role.Logged == Rol_TCH && Gbl.Scope.Current == Sco_SCOPE_CRS) || (Gbl.Usrs.Me.Role.Logged == Rol_DEG_ADM && (Gbl.Scope.Current == Sco_SCOPE_DEG || - Gbl.Scope.Current == Sco_SCOPE_CRS)) || + Gbl.Scope.Current == Sco_SCOPE_CRS)) || (Gbl.Usrs.Me.Role.Logged == Rol_CTR_ADM && (Gbl.Scope.Current == Sco_SCOPE_CTR || - Gbl.Scope.Current == Sco_SCOPE_DEG || - Gbl.Scope.Current == Sco_SCOPE_CRS)) || + Gbl.Scope.Current == Sco_SCOPE_DEG || + Gbl.Scope.Current == Sco_SCOPE_CRS)) || (Gbl.Usrs.Me.Role.Logged == Rol_INS_ADM && (Gbl.Scope.Current == Sco_SCOPE_INS || - Gbl.Scope.Current == Sco_SCOPE_CTR || - Gbl.Scope.Current == Sco_SCOPE_DEG || - Gbl.Scope.Current == Sco_SCOPE_CRS)) || + Gbl.Scope.Current == Sco_SCOPE_CTR || + Gbl.Scope.Current == Sco_SCOPE_DEG || + Gbl.Scope.Current == Sco_SCOPE_CRS)) || Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; if (!ICanQueryWholeRange && NumDays > Cfg_DAYS_IN_RECENT_LOG) { - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_date_range_must_be_less_than_or_equal_to_X_days, - Cfg_DAYS_IN_RECENT_LOG); - Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt); // ...write warning message and show the form again + /* ...write warning message and show the form again */ + Ale_ShowAlert (Ale_WARNING,Txt_The_date_range_must_be_less_than_or_equal_to_X_days, + Cfg_DAYS_IN_RECENT_LOG); return; } @@ -1388,7 +1387,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) /***** Count the number of rows in result *****/ if (NumRows == 0) - Ale_ShowA_old (Ale_INFO,Txt_There_are_no_accesses_with_the_selected_search_criteria); + Ale_ShowAlert (Ale_INFO,Txt_There_are_no_accesses_with_the_selected_search_criteria); else { /***** Put the table with the clicks *****/ diff --git a/swad_string.c b/swad_string.c index 58fc3528a..36e80c795 100644 --- a/swad_string.c +++ b/swad_string.c @@ -953,7 +953,7 @@ void Str_SetDecimalPointToUS (void) { if (!setlocale (LC_NUMERIC,"en_US.utf8")) // To get/print the floating point as a dot if (Gbl.Layout.HTMLStartWritten) - Ale_ShowA_old (Ale_ERROR,"Can not set locale to en_US."); + Ale_ShowAlert (Ale_ERROR,"Can not set locale to en_US."); } /*****************************************************************************/ @@ -965,7 +965,7 @@ void Str_SetDecimalPointToLocal (void) // TODO: this should be internationalized!!!!!!! if (!setlocale (LC_NUMERIC,"es_ES.utf8")) // Return to local system if (Gbl.Layout.HTMLStartWritten) - Ale_ShowA_old (Ale_ERROR,"Can not set locale to es_ES."); + Ale_ShowAlert (Ale_ERROR,"Can not set locale to es_ES."); } /*****************************************************************************/