diff --git a/swad_centre.c b/swad_centre.c index 4af465a2f..9222ffe27 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -225,7 +225,7 @@ void Ctr_SeeCtrWithPendingDegs (void) Box_EndBoxTable (); } else - Ale_ShowA_old (Ale_INFO,Txt_There_are_no_centres_with_requests_for_degrees_to_be_confirmed); + Ale_ShowA_fmt (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_old (Ale_INFO,Txt_No_centres); + Ale_ShowA_fmt (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_old (Ale_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre); + Ale_ShowA_fmt (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,10 +1795,8 @@ void Ctr_RemoveCentre (void) Ctr.CtrCod); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_Centre_X_removed, - Ctr.FullName); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowA_fmt (Ale_SUCCESS,Txt_Centre_X_removed, + Ctr.FullName); } /***** Show the form again *****/ @@ -1830,8 +1828,8 @@ void Ctr_ChangeCtrInsInConfig (void) Gbl.CurrentCtr.Ctr.CtrCod, NewIns.InsCod)) { - Gbl.Alert.Type = Ale_WARNING; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_WARNING; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_The_centre_X_already_exists, Gbl.CurrentCtr.Ctr.ShrtName); } @@ -1840,8 +1838,8 @@ void Ctr_ChangeCtrInsInConfig (void) Gbl.CurrentCtr.Ctr.CtrCod, NewIns.InsCod)) { - Gbl.Alert.Type = Ale_WARNING; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_WARNING; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_The_centre_X_already_exists, Gbl.CurrentCtr.Ctr.FullName); } @@ -1856,8 +1854,8 @@ void Ctr_ChangeCtrInsInConfig (void) Hie_InitHierarchy (); /***** Write message to show the change made *****/ - Gbl.Alert.Type = Ale_SUCCESS; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_SUCCESS; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_The_centre_X_has_been_moved_to_the_institution_Y, Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName); } @@ -1913,8 +1911,8 @@ void Ctr_ChangeCtrPlc (void) /***** Write message to show the change made and put button to go to centre changed *****/ - Gbl.Alert.Type = Ale_SUCCESS; - Str_Copy (Gbl.Alert.Txt,Txt_The_place_of_the_centre_has_changed, + Gbl.AlertToShowLater.Type = Ale_SUCCESS; + Str_Copy (Gbl.AlertToShowLater.Txt,Txt_The_place_of_the_centre_has_changed, Ale_MAX_BYTES_ALERT); Ctr_ShowAlertAndButtonToGoToCtr (); @@ -1935,7 +1933,7 @@ void Ctr_ChangeCtrPlcInConfig (void) Gbl.CurrentCtr.Ctr.PlcCod = NewPlcCod; /***** Write message to show the change made *****/ - Ale_ShowA_old (Ale_SUCCESS,Txt_The_place_of_the_centre_has_changed); + Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_place_of_the_centre_has_changed); /***** Show the form again *****/ Ctr_ShowConfiguration (); @@ -2024,8 +2022,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull /***** Check if new name is empty *****/ if (!NewCtrName[0]) { - Gbl.Alert.Type = Ale_WARNING; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_WARNING; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_You_can_not_leave_the_name_of_the_centre_X_empty, CurrentCtrName); } @@ -2038,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.Alert.Type = Ale_WARNING; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_WARNING; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_The_centre_X_already_exists,NewCtrName); } else @@ -2048,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.Alert.Type = Ale_SUCCESS; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_SUCCESS; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_The_centre_X_has_been_renamed_as_Y, CurrentCtrName,NewCtrName); @@ -2060,8 +2058,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull } else // The same name { - Gbl.Alert.Type = Ale_INFO; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_INFO; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt), Txt_The_name_of_the_centre_X_has_not_changed, CurrentCtrName); } @@ -2123,14 +2121,14 @@ void Ctr_ChangeCtrWWW (void) /***** Write message to show the change made and put button to go to centre changed *****/ - Gbl.Alert.Type = Ale_SUCCESS; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_SUCCESS; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.Alert.Txt), Txt_The_new_web_address_is_X, NewWWW); Ctr_ShowAlertAndButtonToGoToCtr (); } else - Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); + Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); /***** Show the form again *****/ Ctr_EditCentres (); @@ -2155,13 +2153,11 @@ void Ctr_ChangeCtrWWWInConfig (void) Cns_MAX_BYTES_WWW); /***** Write message to show the change made *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - Txt_The_new_web_address_is_X, - NewWWW); - Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt); + Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_new_web_address_is_X, + NewWWW); } else - Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); + Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); /***** Show the form again *****/ Ctr_ShowConfiguration (); @@ -2215,8 +2211,8 @@ void Ctr_ChangeCtrStatus (void) /***** Write message to show the change made and put button to go to centre changed *****/ - Gbl.Alert.Type = Ale_SUCCESS; - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), + Gbl.AlertToShowLater.Type = Ale_SUCCESS; + snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.Alert.Txt), Txt_The_status_of_the_centre_X_has_changed, Gbl.Ctrs.EditingCtr.ShrtName); Ctr_ShowAlertAndButtonToGoToCtr (); @@ -2263,7 +2259,7 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void) } else /***** Alert *****/ - Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt); + Ale_ShowA_new (Gbl.AlertToShowLater.Type,Gbl.AlertToShowLater.Txt); } static void Ctr_PutParamGoToCtr (void) @@ -2319,16 +2315,14 @@ void Ctr_RequestPhoto (void) NULL,Box_NOT_CLOSABLE); /***** Write help message *****/ - snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), - "%s: %s
" - "%s: %u×%u %s", - Txt_Recommended_aspect_ratio, - Ctr_RECOMMENDED_ASPECT_RATIO, - Txt_Recommended_resolution, - Ctr_PHOTO_SAVED_MAX_WIDTH, - Ctr_PHOTO_SAVED_MAX_HEIGHT, - Txt_XxY_pixels_or_higher); - Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt); + Ale_ShowA_fmt (Ale_INFO,"%s: %s
" + "%s: %u×%u %s", + Txt_Recommended_aspect_ratio, + Ctr_RECOMMENDED_ASPECT_RATIO, + Txt_Recommended_resolution, + Ctr_PHOTO_SAVED_MAX_WIDTH, + Ctr_PHOTO_SAVED_MAX_HEIGHT, + Txt_XxY_pixels_or_higher); /***** Upload photo *****/ fprintf (Gbl.F.Out,"