Version 18.6

This commit is contained in:
Antonio Cañas Vargas 2018-10-16 21:56:01 +02:00
parent 863b6e3677
commit 7c83401c26
49 changed files with 1637 additions and 1105 deletions

View File

@ -810,7 +810,9 @@ static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe)
/***** Show message *****/ /***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_ID_X_removed,UsrID); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ID_X_removed,
UsrID);
} }
else else
{ {
@ -950,8 +952,9 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_matches_one_of_the_existing, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewID); Txt_The_ID_X_matches_one_of_the_existing,
NewID);
} }
else // It's not me && !Confirmed else // It's not me && !Confirmed
{ {
@ -960,16 +963,18 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewID); Txt_The_ID_X_has_been_confirmed,
NewID);
} }
} }
else if (UsrDat->IDs.Num >= ID_MAX_IDS_PER_USER) else if (UsrDat->IDs.Num >= ID_MAX_IDS_PER_USER)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_A_user_can_not_have_more_than_X_IDs, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ID_MAX_IDS_PER_USER); 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 else // OK ==> add this new ID to my list of IDs
{ {
@ -980,15 +985,18 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_registered_successfully, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewID); Txt_The_ID_X_has_been_registered_successfully,
NewID);
} }
} }
else // New ID is not valid else // New ID is not valid
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,NewID); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_is_not_valid,
NewID);
} }
} }
else else
@ -1074,8 +1082,9 @@ void ID_ConfirmOtherUsrID (void)
/***** ID found and already confirmed *****/ /***** ID found and already confirmed *****/
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_ID_X_had_already_been_confirmed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID); Txt_ID_X_had_already_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
} }
else else
{ {
@ -1087,8 +1096,9 @@ void ID_ConfirmOtherUsrID (void)
/***** Write success message *****/ /***** Write success message *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID; Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID); Txt_The_ID_X_has_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
} }
} }
else // User's ID not found else // User's ID not found

View File

@ -247,8 +247,9 @@ void Acc_CheckIfEmptyAccountExists (void)
} }
else else
{ {
sprintf (Gbl.Alert.Txt,Txt_There_is_no_empty_account_associated_with_your_ID_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ID); Txt_There_is_no_empty_account_associated_with_your_ID_X,
ID);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
@ -630,18 +631,20 @@ 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 if (DB_QueryCOUNT (Query,"can not check if nickname already existed")) // A nickname of another user is the same that this nickname
{ {
Error = true; Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNicknameWithoutArroba); Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
else // New nickname is not valid else // New nickname is not valid
{ {
Error = true; Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNicknameWithArroba, Txt_The_nickname_entered_X_is_not_valid_,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA, NewNicknameWithArroba,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA); Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
@ -658,16 +661,18 @@ 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 if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email
{ {
Error = true; Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewEmail); Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
else // New email is not valid else // New email is not valid
{ {
Error = true; Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewEmail); Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
@ -836,9 +841,10 @@ void Acc_AfterCreationNewAccount (void)
if (Gbl.Usrs.Me.Logged) // If account has been created without problem, I am logged if (Gbl.Usrs.Me.Logged) // If account has been created without problem, I am logged
{ {
/***** Show message of success *****/ /***** Show message of success *****/
sprintf (Gbl.Alert.Txt,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Me.UsrDat.Nickname, Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
Cfg_PLATFORM_SHORT_NAME); Gbl.Usrs.Me.UsrDat.Nickname,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show form with account data *****/ /***** Show form with account data *****/
@ -1038,8 +1044,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
if (QuietOrVerbose == Cns_VERBOSE) if (QuietOrVerbose == Cns_VERBOSE)
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1050,8 +1057,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
if (QuietOrVerbose == Cns_VERBOSE) if (QuietOrVerbose == Cns_VERBOSE)
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_THE_USER_X_has_been_removed_as_administrator,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1065,8 +1073,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Acc_RemoveUsrBriefcase (UsrDat); Acc_RemoveUsrBriefcase (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE) if (QuietOrVerbose == Cns_VERBOSE)
{ {
sprintf (Gbl.Alert.Txt,Txt_Briefcase_of_THE_USER_X_has_been_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_Briefcase_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1081,8 +1090,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod); Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE) if (QuietOrVerbose == Cns_VERBOSE)
{ {
sprintf (Gbl.Alert.Txt,Txt_Messages_of_THE_USER_X_have_been_deleted, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_Messages_of_THE_USER_X_have_been_deleted,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1128,8 +1138,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
PhotoRemoved = Pho_RemovePhoto (UsrDat); PhotoRemoved = Pho_RemovePhoto (UsrDat);
if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE) if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE)
{ {
sprintf (Gbl.Alert.Txt,Txt_Photo_of_THE_USER_X_has_been_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_Photo_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1137,8 +1148,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Acc_RemoveUsr (UsrDat); Acc_RemoveUsr (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE) if (QuietOrVerbose == Cns_VERBOSE)
{ {
sprintf (Gbl.Alert.Txt,Txt_Record_card_of_THE_USER_X_has_been_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_Record_card_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }

View File

@ -1299,8 +1299,9 @@ void Agd_AskRemEvent (void)
/***** Show question and button to remove event *****/ /***** Show question and button to remove event *****/
Gbl.Agenda.AgdCodToEdit = AgdEvent.AgdCod; Gbl.Agenda.AgdCodToEdit = AgdEvent.AgdCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
AgdEvent.Event); Txt_Do_you_really_want_to_remove_the_event_X,
AgdEvent.Event);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemEvtMyAgd,NULL,NULL, ActRemEvtMyAgd,NULL,NULL,
Agd_PutCurrentParamsMyAgenda, Agd_PutCurrentParamsMyAgenda,
@ -1335,7 +1336,9 @@ void Agd_RemoveEvent (void)
DB_QueryDELETE (Query,"can not remove event"); DB_QueryDELETE (Query,"can not remove event");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,AgdEvent.Event); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_removed,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/ /***** Show events again *****/
@ -1367,7 +1370,9 @@ void Agd_HideEvent (void)
DB_QueryUPDATE (Query,"can not hide event"); DB_QueryUPDATE (Query,"can not hide event");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,AgdEvent.Event); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_hidden,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/ /***** Show events again *****/
@ -1399,8 +1404,9 @@ void Agd_UnhideEvent (void)
DB_QueryUPDATE (Query,"can not show event"); DB_QueryUPDATE (Query,"can not show event");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
AgdEvent.Event); Txt_Event_X_is_now_visible,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/ /***** Show events again *****/
@ -1432,7 +1438,9 @@ void Agd_MakeEventPrivate (void)
DB_QueryUPDATE (Query,"can not make event private"); DB_QueryUPDATE (Query,"can not make event private");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_private,AgdEvent.Event); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_private,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/ /***** Show events again *****/
@ -1464,8 +1472,9 @@ void Agd_MakeEventPublic (void)
DB_QueryUPDATE (Query,"can not make event public"); DB_QueryUPDATE (Query,"can not make event public");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible_to_users_of_your_courses, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
AgdEvent.Event); Txt_Event_X_is_now_visible_to_users_of_your_courses,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/ /***** Show events again *****/
@ -1664,7 +1673,9 @@ void Agd_RecFormEvent (void)
Agd_CreateEvent (&AgdEvent,Txt); // Add new event to database Agd_CreateEvent (&AgdEvent,Txt); // Add new event to database
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,AgdEvent.Event); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_event_X,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else

View File

@ -972,8 +972,9 @@ void Asg_ReqRemAssignment (void)
/***** Show question and button to remove the assignment *****/ /***** Show question and button to remove the assignment *****/
Gbl.Asgs.AsgCodToEdit = Asg.AsgCod; Gbl.Asgs.AsgCodToEdit = Asg.AsgCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_assignment_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Asg.Title); Txt_Do_you_really_want_to_remove_the_assignment_X,
Asg.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemAsg,NULL,NULL,Asg_PutParams, ActRemAsg,NULL,NULL,Asg_PutParams,
Btn_REMOVE_BUTTON,Txt_Remove_assignment); Btn_REMOVE_BUTTON,Txt_Remove_assignment);
@ -1016,8 +1017,9 @@ void Asg_RemoveAssignment (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Asg.Title); Txt_Assignment_X_removed,
Asg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show assignments again *****/ /***** Show assignments again *****/
@ -1048,8 +1050,9 @@ void Asg_HideAssignment (void)
DB_QueryUPDATE (Query,"can not hide assignment"); DB_QueryUPDATE (Query,"can not hide assignment");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_hidden, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Asg.Title); Txt_Assignment_X_is_now_hidden,
Asg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show assignments again *****/ /***** Show assignments again *****/
@ -1080,8 +1083,9 @@ void Asg_ShowAssignment (void)
DB_QueryUPDATE (Query,"can not show assignment"); DB_QueryUPDATE (Query,"can not show assignment");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Asg.Title); Txt_Assignment_X_is_now_visible,
Asg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show assignments again *****/ /***** Show assignments again *****/
@ -1368,8 +1372,9 @@ void Asg_RecFormAssignment (void)
if (Asg_CheckIfSimilarAssignmentExists ("Title",NewAsg.Title,NewAsg.AsgCod)) if (Asg_CheckIfSimilarAssignmentExists ("Title",NewAsg.Title,NewAsg.AsgCod))
{ {
NewAssignmentIsCorrect = false; NewAssignmentIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_title_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewAsg.Title); Txt_Already_existed_an_assignment_with_the_title_X,
NewAsg.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Title is correct else // Title is correct
@ -1381,8 +1386,9 @@ void Asg_RecFormAssignment (void)
if (Asg_CheckIfSimilarAssignmentExists ("Folder",NewAsg.Folder,NewAsg.AsgCod)) // If folder of assignment was in database... if (Asg_CheckIfSimilarAssignmentExists ("Folder",NewAsg.Folder,NewAsg.AsgCod)) // If folder of assignment was in database...
{ {
NewAssignmentIsCorrect = false; NewAssignmentIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewAsg.Folder); Txt_Already_existed_an_assignment_with_the_folder_X,
NewAsg.Folder);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
@ -1422,7 +1428,9 @@ void Asg_RecFormAssignment (void)
Asg_CreateAssignment (&NewAsg,Txt); // Add new assignment to database Asg_CreateAssignment (&NewAsg,Txt); // Add new assignment to database
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_assignment_X,NewAsg.Title); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_assignment_X,
NewAsg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else

View File

@ -887,8 +887,9 @@ void Att_AskRemAttEvent (void)
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage); Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage);
/***** Ask for confirmation of removing *****/ /***** Ask for confirmation of removing *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Att.Title); Txt_Do_you_really_want_to_remove_the_event_X,
Att.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Btn_PutRemoveButton (Txt_Remove_event); Btn_PutRemoveButton (Txt_Remove_event);
Act_EndForm (); Act_EndForm ();
@ -918,7 +919,9 @@ void Att_GetAndRemAttEvent (void)
Att_RemoveAttEventFromDB (Att.AttCod); Att_RemoveAttEventFromDB (Att.AttCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,Att.Title); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_removed,
Att.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
@ -965,8 +968,9 @@ void Att_HideAttEvent (void)
DB_QueryUPDATE (Query,"can not hide attendance event"); DB_QueryUPDATE (Query,"can not hide attendance event");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Att.Title); Txt_Event_X_is_now_hidden,
Att.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
@ -997,8 +1001,9 @@ void Att_ShowAttEvent (void)
DB_QueryUPDATE (Query,"can not show attendance event"); DB_QueryUPDATE (Query,"can not show attendance event");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Att.Title); Txt_Event_X_is_now_visible,
Att.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/ /***** Show attendance events again *****/
@ -1282,8 +1287,9 @@ void Att_RecFormAttEvent (void)
if (Att_CheckIfSimilarAttEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod)) if (Att_CheckIfSimilarAttEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod))
{ {
ReceivedAttEventIsCorrect = false; ReceivedAttEventIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_event_with_the_title_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ReceivedAtt.Title); Txt_Already_existed_an_event_with_the_title_X,
ReceivedAtt.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
@ -1305,7 +1311,9 @@ void Att_RecFormAttEvent (void)
Att_CreateAttEvent (&ReceivedAtt,Txt); // Add new attendance event to database Att_CreateAttEvent (&ReceivedAtt,Txt); // Add new attendance event to database
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,ReceivedAtt.Title); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_event_X,
ReceivedAtt.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2396,8 +2404,9 @@ void Att_RegisterStudentsInAttEvent (void)
/***** Write final message *****/ /***** Write final message *****/
sprintf (Format,"%s: %%u<br />%s: %%u",Txt_Presents,Txt_Absents); sprintf (Format,"%s: %%u<br />%s: %%u",Txt_Presents,Txt_Absents);
sprintf (Gbl.Alert.Txt,Format, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumStdsPresent,NumStdsAbsent); Format,
NumStdsPresent,NumStdsAbsent);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0 else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0

View File

@ -521,8 +521,9 @@ void Ban_RemoveBanner (void)
DB_QueryDELETE (Query,"can not remove a banner"); DB_QueryDELETE (Query,"can not remove a banner");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Banner_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Ban.ShrtName); Txt_Banner_X_removed,
Ban.ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -579,9 +580,10 @@ static void Ban_ShowOrHideBanner (bool Hide)
} }
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Hide ? Txt_The_banner_X_is_now_hidden : snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_banner_X_is_now_visible, Hide ? Txt_The_banner_X_is_now_hidden :
Ban.ShrtName); Txt_The_banner_X_is_now_visible,
Ban.ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -654,8 +656,9 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewBanName[0]) if (!NewBanName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_banner_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentBanName); Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
CurrentBanName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -666,8 +669,9 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If banner was in database... *****/ /***** If banner was in database... *****/
if (Ban_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod)) if (Ban_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewBanName); Txt_The_banner_X_already_exists,
NewBanName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -676,15 +680,17 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
Ban_UpdateBanNameDB (Ban->BanCod,FieldName,NewBanName); Ban_UpdateBanNameDB (Ban->BanCod,FieldName,NewBanName);
/* Write message to show the change made */ /* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentBanName,NewBanName); Txt_The_banner_X_has_been_renamed_as_Y,
CurrentBanName,NewBanName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_banner_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentBanName); Txt_The_name_of_the_banner_X_has_not_changed,
CurrentBanName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -755,8 +761,9 @@ void Ban_ChangeBannerImg (void)
DB_QueryUPDATE (Query,"can not update the image of a banner"); DB_QueryUPDATE (Query,"can not update the image of a banner");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_image_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewImg); Txt_The_new_image_is_X,
NewImg);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -800,8 +807,9 @@ void Ban_ChangeBannerWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a banner"); DB_QueryUPDATE (Query,"can not update the web of a banner");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewWWW); Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -946,14 +954,16 @@ void Ban_RecFormNewBanner (void)
/***** If name of banner was in database... *****/ /***** If name of banner was in database... *****/
if (Ban_CheckIfBannerNameExists ("ShortName",Ban->ShrtName,-1L)) if (Ban_CheckIfBannerNameExists ("ShortName",Ban->ShrtName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Ban->ShrtName); Txt_The_banner_X_already_exists,
Ban->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Ban_CheckIfBannerNameExists ("FullName",Ban->FullName,-1L)) else if (Ban_CheckIfBannerNameExists ("FullName",Ban->FullName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Ban->FullName); Txt_The_banner_X_already_exists,
Ban->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (!Ban->Img[0]) else if (!Ban->Img[0])
@ -988,8 +998,9 @@ static void Ban_CreateBanner (struct Banner *Ban)
DB_QueryINSERT (Query,"can not create banner"); DB_QueryINSERT (Query,"can not create banner");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_banner_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Ban->ShrtName); Txt_Created_new_banner_X,
Ban->ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -1775,8 +1775,9 @@ void Ctr_RemoveCentre (void)
DB_QueryDELETE (Query,"can not remove a centre"); DB_QueryDELETE (Query,"can not remove a centre");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Centre_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Ctr.FullName); Txt_Centre_X_removed,
Ctr.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1810,8 +1811,9 @@ void Ctr_ChangeCtrInsInConfig (void)
NewIns.InsCod)) NewIns.InsCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCtr.Ctr.ShrtName); Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.ShrtName);
} }
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName", else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",
Gbl.CurrentCtr.Ctr.FullName, Gbl.CurrentCtr.Ctr.FullName,
@ -1819,8 +1821,9 @@ void Ctr_ChangeCtrInsInConfig (void)
NewIns.InsCod)) NewIns.InsCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCtr.Ctr.FullName); Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.FullName);
} }
else else
{ {
@ -1834,8 +1837,9 @@ void Ctr_ChangeCtrInsInConfig (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_moved_to_the_institution_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName); Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName);
} }
} }
} }
@ -2005,8 +2009,9 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
if (!NewCtrName[0]) if (!NewCtrName[0])
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_centre_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentCtrName); Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
CurrentCtrName);
} }
else else
{ {
@ -2017,7 +2022,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod)) if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,NewCtrName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_already_exists,NewCtrName);
} }
else else
{ {
@ -2026,8 +2032,9 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/* Write message to show the change made */ /* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentCtrName,NewCtrName); Txt_The_centre_X_has_been_renamed_as_Y,
CurrentCtrName,NewCtrName);
/* Change current centre name in order to display it properly */ /* Change current centre name in order to display it properly */
Str_Copy (CurrentCtrName,NewCtrName, Str_Copy (CurrentCtrName,NewCtrName,
@ -2037,8 +2044,9 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
else // The same name else // The same name
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_centre_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentCtrName); Txt_The_name_of_the_centre_X_has_not_changed,
CurrentCtrName);
} }
} }
} }
@ -2102,7 +2110,9 @@ void Ctr_ChangeCtrWWW (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to centre changed *****/ and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ctr_ShowAlertAndButtonToGoToCtr (); Ctr_ShowAlertAndButtonToGoToCtr ();
} }
else else
@ -2131,7 +2141,9 @@ void Ctr_ChangeCtrWWWInConfig (void)
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2193,8 +2205,9 @@ void Ctr_ChangeCtrStatus (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to centre changed *****/ and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_centre_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Ctrs.EditingCtr.ShrtName); Txt_The_status_of_the_centre_X_has_changed,
Gbl.Ctrs.EditingCtr.ShrtName);
Ctr_ShowAlertAndButtonToGoToCtr (); Ctr_ShowAlertAndButtonToGoToCtr ();
/***** Show the form again *****/ /***** Show the form again *****/
@ -2293,14 +2306,15 @@ void Ctr_RequestPhoto (void)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/ /***** Write help message *****/
sprintf (Gbl.Alert.Txt,"%s: %s<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %u&times;%u %s", "%s: %s<br />"
Txt_Recommended_aspect_ratio, "%s: %u&times;%u %s",
Ctr_RECOMMENDED_ASPECT_RATIO, Txt_Recommended_aspect_ratio,
Txt_Recommended_resolution, Ctr_RECOMMENDED_ASPECT_RATIO,
Ctr_PHOTO_SAVED_MAX_WIDTH, Txt_Recommended_resolution,
Ctr_PHOTO_SAVED_MAX_HEIGHT, Ctr_PHOTO_SAVED_MAX_WIDTH,
Txt_XxY_pixels_or_higher); Ctr_PHOTO_SAVED_MAX_HEIGHT,
Txt_XxY_pixels_or_higher);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Upload photo *****/ /***** Upload photo *****/
@ -2428,9 +2442,10 @@ void Ctr_ReceivePhoto (void)
ReturnCode = WEXITSTATUS(ReturnCode); ReturnCode = WEXITSTATUS(ReturnCode);
if (ReturnCode != 0) if (ReturnCode != 0)
{ {
sprintf (Gbl.Alert.Txt,"Image could not be processed successfully.<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Error code returned by the program of processing: %d", "Image could not be processed successfully.<br />"
ReturnCode); "Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
@ -2756,14 +2771,16 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
/***** If name of centre was in database... *****/ /***** If name of centre was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod)) if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Ctrs.EditingCtr.ShrtName); Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Gbl.Ctrs.EditingCtr.FullName,-1L,Gbl.CurrentIns.Ins.InsCod)) else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Gbl.Ctrs.EditingCtr.FullName,-1L,Gbl.CurrentIns.Ins.InsCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Ctrs.EditingCtr.FullName); Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new centre to database else // Add new centre to database
@ -2811,8 +2828,9 @@ static void Ctr_CreateCentre (unsigned Status)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to centre created *****/ and put button to go to centre created *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_centre_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Ctrs.EditingCtr.FullName); Txt_Created_new_centre_X,
Gbl.Ctrs.EditingCtr.FullName);
Ctr_ShowAlertAndButtonToGoToCtr (); Ctr_ShowAlertAndButtonToGoToCtr ();
} }

View File

@ -355,10 +355,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.5.3 (2018-10-16)" #define Log_PLATFORM_VERSION "SWAD 18.6 (2018-10-16)"
#define CSS_FILE "swad18.4.css" #define CSS_FILE "swad18.4.css"
#define JS_FILE "swad17.17.1.js" #define JS_FILE "swad17.17.1.js"
/* /*
Version 18.6: Oct 16, 2018 sprintf changed by snprintf in alerts. (235730 lines)
Version 18.5.3: Oct 16, 2018 sprintf changed by safe string copy in some alerts. (235198 lines) Version 18.5.3: Oct 16, 2018 sprintf changed by safe string copy in some alerts. (235198 lines)
Version 18.5.2: Oct 16, 2018 Code refactoring related to password change. (235170 lines) Version 18.5.2: Oct 16, 2018 Code refactoring related to password change. (235170 lines)
Version 18.5.1: Oct 16, 2018 Code refactoring related to edition of another user's account. (235212 lines) Version 18.5.1: Oct 16, 2018 Code refactoring related to edition of another user's account. (235212 lines)

View File

@ -80,9 +80,10 @@ void Cht_ShowChatRooms (void)
extern const char *Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_; extern const char *Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_;
/***** Help message about software needed to use the whiteboard/chat *****/ /***** Help message about software needed to use the whiteboard/chat *****/
sprintf (Gbl.Alert.Txt,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cfg_JAVA_URL,Cfg_JAVA_NAME, Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
Cfg_PLATFORM_SERVER); Cfg_JAVA_URL,Cfg_JAVA_NAME,
Cfg_PLATFORM_SERVER);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** List available chat rooms *****/ /***** List available chat rooms *****/

View File

@ -1709,8 +1709,9 @@ void Cty_RemoveCountry (void)
Cty_FlushCacheCountryName (); Cty_FlushCacheCountryName ();
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Country_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty.Name[Gbl.Prefs.Language]); Txt_Country_X_removed,
Cty.Name[Gbl.Prefs.Language]);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1751,8 +1752,9 @@ void Cty_RenameCountry (void)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewCtyName[0]) if (!NewCtyName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_country_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Name[Language]); Txt_You_can_not_leave_the_name_of_the_country_X_empty,
Cty->Name[Language]);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -1763,8 +1765,9 @@ void Cty_RenameCountry (void)
/***** If country was in database... *****/ /***** If country was in database... *****/
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod)) if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewCtyName); Txt_The_country_X_already_exists,
NewCtyName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -1774,8 +1777,9 @@ void Cty_RenameCountry (void)
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName); Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
/* Write message to show the change made */ /* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_country_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Name[Language],NewCtyName); Txt_The_country_X_has_been_renamed_as_Y,
Cty->Name[Language],NewCtyName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/* Update country name */ /* Update country name */
@ -1785,8 +1789,9 @@ void Cty_RenameCountry (void)
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_country_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Name[Language]); Txt_The_name_of_the_country_X_has_not_changed,
Cty->Name[Language]);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -1892,7 +1897,9 @@ void Cty_ChangeCtyWWW (void)
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -2102,7 +2109,8 @@ void Cty_RecFormNewCountry (void)
} }
else if (Cty_CheckIfNumericCountryCodeExists (Cty->CtyCod)) else if (Cty_CheckIfNumericCountryCodeExists (Cty->CtyCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_numerical_code_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_numerical_code_X_already_exists,
Cty->CtyCod); Cty->CtyCod);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false; CreateCountry = false;
@ -2118,8 +2126,9 @@ void Cty_RecFormNewCountry (void)
if (Cty->Alpha2[i] < 'A' || if (Cty->Alpha2[i] < 'A' ||
Cty->Alpha2[i] > 'Z') Cty->Alpha2[i] > 'Z')
{ {
sprintf (Gbl.Alert.Txt,Txt_The_alphabetical_code_X_is_not_correct, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Alpha2); Txt_The_alphabetical_code_X_is_not_correct,
Cty->Alpha2);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false; CreateCountry = false;
} }
@ -2127,8 +2136,9 @@ void Cty_RecFormNewCountry (void)
{ {
if (Cty_CheckIfAlpha2CountryCodeExists (Cty->Alpha2)) if (Cty_CheckIfAlpha2CountryCodeExists (Cty->Alpha2))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_alphabetical_code_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Alpha2); Txt_The_alphabetical_code_X_already_exists,
Cty->Alpha2);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false; CreateCountry = false;
} }
@ -2147,8 +2157,9 @@ void Cty_RecFormNewCountry (void)
/***** If name of country was in database... *****/ /***** If name of country was in database... *****/
if (Cty_CheckIfCountryNameExists (Lan,Cty->Name[Lan],-1L)) if (Cty_CheckIfCountryNameExists (Lan,Cty->Name[Lan],-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Name[Lan]); Txt_The_country_X_already_exists,
Cty->Name[Lan]);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false; CreateCountry = false;
break; break;
@ -2238,8 +2249,9 @@ static void Cty_CreateCountry (struct Country *Cty)
DB_QueryINSERT (Query,"can not create country"); DB_QueryINSERT (Query,"can not create country");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_country_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cty->Name); Txt_Created_new_country_X,
Cty->Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -1336,7 +1336,9 @@ void Crs_EditCourses (void)
Deg_GetListDegsOfCurrentCtr (); Deg_GetListDegsOfCurrentCtr ();
/***** Start box *****/ /***** Start box *****/
sprintf (Gbl.Alert.Txt,Txt_Courses_of_DEGREE_X,Gbl.CurrentDeg.Deg.ShrtName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Courses_of_DEGREE_X,
Gbl.CurrentDeg.Deg.ShrtName);
Box_StartBox (NULL,Gbl.Alert.Txt,Crs_PutIconToViewCourses, Box_StartBox (NULL,Gbl.Alert.Txt,Crs_PutIconToViewCourses,
Hlp_DEGREE_Courses,Box_NOT_CLOSABLE); Hlp_DEGREE_Courses,Box_NOT_CLOSABLE);
@ -1864,15 +1866,17 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status)
Gbl.Degs.EditingCrs.DegCod,Gbl.Degs.EditingCrs.Year)) Gbl.Degs.EditingCrs.DegCod,Gbl.Degs.EditingCrs.Year))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.ShrtName); Txt_The_course_X_already_exists,
Gbl.Degs.EditingCrs.ShrtName);
} }
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Degs.EditingCrs.FullName,-1L, else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Degs.EditingCrs.FullName,-1L,
Gbl.Degs.EditingCrs.DegCod,Gbl.Degs.EditingCrs.Year)) Gbl.Degs.EditingCrs.DegCod,Gbl.Degs.EditingCrs.Year))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.FullName); Txt_The_course_X_already_exists,
Gbl.Degs.EditingCrs.FullName);
} }
else // Add new requested course to database else // Add new requested course to database
Crs_CreateCourse (Status); Crs_CreateCourse (Status);
@ -1887,8 +1891,9 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status)
else // Year not valid else // Year not valid
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.Year); Txt_The_year_X_is_not_allowed,
Gbl.Degs.EditingCrs.Year);
} }
} }
@ -1941,8 +1946,9 @@ static void Crs_CreateCourse (unsigned Status)
/***** Create success message *****/ /***** Create success message *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_course_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.FullName); Txt_Created_new_course_X,
Gbl.Degs.EditingCrs.FullName);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1973,8 +1979,9 @@ void Crs_RemoveCourse (void)
Crs_RemoveCourseCompletely (Crs.CrsCod); Crs_RemoveCourseCompletely (Crs.CrsCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Course_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Crs.FullName); Txt_Course_X_removed,
Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
@ -2295,12 +2302,14 @@ void Crs_ChangeInsCrsCodInConfig (void)
{ {
Crs_UpdateInstitutionalCrsCod (&Gbl.CurrentCrs.Crs,NewInstitutionalCrsCod); Crs_UpdateInstitutionalCrsCod (&Gbl.CurrentCrs.Crs,NewInstitutionalCrsCod);
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.ShrtName,NewInstitutionalCrsCod); Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Gbl.CurrentCrs.Crs.ShrtName,NewInstitutionalCrsCod);
} }
else // The same institutional code else // The same institutional code
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.ShrtName); Txt_The_institutional_code_of_the_course_X_has_not_changed,
Gbl.CurrentCrs.Crs.ShrtName);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -2331,14 +2340,16 @@ void Crs_ChangeInsCrsCod (void)
{ {
Crs_UpdateInstitutionalCrsCod (&Gbl.Degs.EditingCrs,NewInstitutionalCrsCod); Crs_UpdateInstitutionalCrsCod (&Gbl.Degs.EditingCrs,NewInstitutionalCrsCod);
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.ShrtName,NewInstitutionalCrsCod); Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Gbl.Degs.EditingCrs.ShrtName,NewInstitutionalCrsCod);
} }
else // The same institutional code else // The same institutional code
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.ShrtName); Txt_The_institutional_code_of_the_course_X_has_not_changed,
Gbl.Degs.EditingCrs.ShrtName);
} }
} }
else else
@ -2374,15 +2385,19 @@ void Crs_ChangeCrsDegInConfig (void)
NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year)) NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,Gbl.CurrentCrs.Crs.ShrtName); Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,
Gbl.CurrentCrs.Crs.ShrtName);
} }
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.CurrentCrs.Crs.FullName,-1L, else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.CurrentCrs.Crs.FullName,-1L,
NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year)) NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,
Gbl.CurrentCrs.Crs.FullName);
} }
else // Update degree in database else // Update degree in database
{ {
@ -2396,9 +2411,10 @@ void Crs_ChangeCrsDegInConfig (void)
/***** Create message to show the change made *****/ /***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_has_been_moved_to_the_degree_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName, Txt_The_course_X_has_been_moved_to_the_degree_Y,
Gbl.CurrentDeg.Deg.FullName); Gbl.CurrentCrs.Crs.FullName,
Gbl.CurrentDeg.Deg.FullName);
} }
} }
} }
@ -2454,15 +2470,17 @@ void Crs_ChangeCrsYearInConfig (void)
Gbl.CurrentCrs.Crs.DegCod,NewYear)) Gbl.CurrentCrs.Crs.DegCod,NewYear))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.ShrtName,Txt_YEAR_OF_DEGREE[NewYear]); Txt_The_course_X_already_exists_in_year_Y,
Gbl.CurrentCrs.Crs.ShrtName,Txt_YEAR_OF_DEGREE[NewYear]);
} }
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.CurrentCrs.Crs.FullName,-1L, else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.CurrentCrs.Crs.FullName,-1L,
Gbl.CurrentCrs.Crs.DegCod,NewYear)) Gbl.CurrentCrs.Crs.DegCod,NewYear))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName,Txt_YEAR_OF_DEGREE[NewYear]); Txt_The_course_X_already_exists_in_year_Y,
Gbl.CurrentCrs.Crs.FullName,Txt_YEAR_OF_DEGREE[NewYear]);
} }
else // Update year in database else // Update year in database
{ {
@ -2471,14 +2489,17 @@ void Crs_ChangeCrsYearInConfig (void)
/***** Create message to show the change made *****/ /***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_year_of_the_course_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.ShrtName); Txt_The_year_of_the_course_X_has_changed,
Gbl.CurrentCrs.Crs.ShrtName);
} }
} }
else // Year not valid else // Year not valid
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,NewYear); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_X_is_not_allowed,
NewYear);
} }
} }
@ -2519,15 +2540,17 @@ void Crs_ChangeCrsYear (void)
Gbl.Degs.EditingCrs.DegCod,NewYear)) Gbl.Degs.EditingCrs.DegCod,NewYear))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.ShrtName,Txt_YEAR_OF_DEGREE[NewYear]); Txt_The_course_X_already_exists_in_year_Y,
Gbl.Degs.EditingCrs.ShrtName,Txt_YEAR_OF_DEGREE[NewYear]);
} }
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Degs.EditingCrs.FullName,-1L, else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Degs.EditingCrs.FullName,-1L,
Gbl.Degs.EditingCrs.DegCod,NewYear)) Gbl.Degs.EditingCrs.DegCod,NewYear))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.FullName,Txt_YEAR_OF_DEGREE[NewYear]); Txt_The_course_X_already_exists_in_year_Y,
Gbl.Degs.EditingCrs.FullName,Txt_YEAR_OF_DEGREE[NewYear]);
} }
else // Update year in database else // Update year in database
{ {
@ -2536,14 +2559,17 @@ void Crs_ChangeCrsYear (void)
/***** Create message to show the change made *****/ /***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_year_of_the_course_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.ShrtName); Txt_The_year_of_the_course_X_has_changed,
Gbl.Degs.EditingCrs.ShrtName);
} }
} }
else // Year not valid else // Year not valid
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,NewYear); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_X_is_not_allowed,
NewYear);
} }
} }
else else
@ -2665,8 +2691,9 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
if (!NewCrsName[0]) if (!NewCrsName[0])
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_course_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentCrsName); Txt_You_can_not_leave_the_name_of_the_course_X_empty,
CurrentCrsName);
} }
else else
{ {
@ -2678,8 +2705,9 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
Crs->DegCod,Crs->Year)) Crs->DegCod,Crs->Year))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewCrsName); Txt_The_course_X_already_exists,
NewCrsName);
} }
else else
{ {
@ -2688,8 +2716,9 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
/* Create message to show the change made */ /* Create message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_course_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentCrsName,NewCrsName); Txt_The_name_of_the_course_X_has_changed_to_Y,
CurrentCrsName,NewCrsName);
/* Change current course name in order to display it properly */ /* Change current course name in order to display it properly */
Str_Copy (CurrentCrsName,NewCrsName, Str_Copy (CurrentCrsName,NewCrsName,
@ -2699,8 +2728,9 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
else // The same name else // The same name
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_course_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentCrsName); Txt_The_name_of_the_course_X_has_not_changed,
CurrentCrsName);
} }
} }
} }
@ -2780,8 +2810,9 @@ void Crs_ChangeCrsStatus (void)
/***** Create message to show the change made *****/ /***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_course_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingCrs.ShrtName); Txt_The_status_of_the_course_X_has_changed,
Gbl.Degs.EditingCrs.ShrtName);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -3426,10 +3457,11 @@ void Crs_RemoveOldCrss (void)
SecondsWithoutAccess); SecondsWithoutAccess);
if ((NumCrss = DB_QuerySELECT (Query,&mysql_res,"can not get old users"))) if ((NumCrss = DB_QuerySELECT (Query,&mysql_res,"can not get old users")))
{ {
sprintf (Gbl.Alert.Txt,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumCrss, Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
MonthsWithoutAccess, NumCrss,
Cfg_PLATFORM_SHORT_NAME); MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Remove courses *****/ /***** Remove courses *****/
@ -3448,7 +3480,8 @@ void Crs_RemoveOldCrss (void)
} }
/***** Write end message *****/ /***** Write end message *****/
sprintf (Gbl.Alert.Txt,Txt_X_courses_have_been_eliminated, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumCrssRemoved); Txt_X_courses_have_been_eliminated,
NumCrssRemoved);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -1153,8 +1153,9 @@ static void Deg_CreateDegree (unsigned Status)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to degree created *****/ and put button to go to degree created *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_degree_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingDeg.FullName); Txt_Created_new_degree_X,
Gbl.Degs.EditingDeg.FullName);
Deg_ShowAlertAndButtonToGoToDeg (); Deg_ShowAlertAndButtonToGoToDeg ();
} }
@ -1560,14 +1561,16 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status)
/***** If name of degree was in database... *****/ /***** If name of degree was in database... *****/
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Degs.EditingDeg.ShrtName,-1L,Gbl.Degs.EditingDeg.CtrCod)) if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Degs.EditingDeg.ShrtName,-1L,Gbl.Degs.EditingDeg.CtrCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingDeg.ShrtName); Txt_The_degree_X_already_exists,
Gbl.Degs.EditingDeg.ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Gbl.Degs.EditingDeg.FullName,-1L,Gbl.Degs.EditingDeg.CtrCod)) else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Gbl.Degs.EditingDeg.FullName,-1L,Gbl.Degs.EditingDeg.CtrCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingDeg.FullName); Txt_The_degree_X_already_exists,
Gbl.Degs.EditingDeg.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new degree to database else // Add new degree to database
@ -1608,8 +1611,9 @@ void Deg_RemoveDegree (void)
Deg_RemoveDegreeCompletely (Deg.DegCod); Deg_RemoveDegreeCompletely (Deg.DegCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Degree_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Deg.FullName); Txt_Degree_X_removed,
Deg.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1966,8 +1970,9 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
if (!NewDegName[0]) if (!NewDegName[0])
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_degree_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentDegName); Txt_You_can_not_leave_the_name_of_the_degree_X_empty,
CurrentDegName);
} }
else else
{ {
@ -1978,7 +1983,9 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
if (Deg_CheckIfDegNameExistsInCtr (ParamName,NewDegName,Deg->DegCod,Deg->CtrCod)) if (Deg_CheckIfDegNameExistsInCtr (ParamName,NewDegName,Deg->DegCod,Deg->CtrCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,NewDegName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_already_exists,
NewDegName);
} }
else else
{ {
@ -1987,8 +1994,9 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
/* Write message to show the change made */ /* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_degree_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentDegName,NewDegName); Txt_The_name_of_the_degree_X_has_changed_to_Y,
CurrentDegName,NewDegName);
/* Change current degree name in order to display it properly */ /* Change current degree name in order to display it properly */
Str_Copy (CurrentDegName,NewDegName, Str_Copy (CurrentDegName,NewDegName,
@ -1998,8 +2006,9 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
else // The same name else // The same name
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_degree_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentDegName); Txt_The_name_of_the_degree_X_has_not_changed,
CurrentDegName);
} }
} }
} }
@ -2056,14 +2065,16 @@ void Deg_ChangeDegCtrInConfig (void)
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.CurrentDeg.Deg.ShrtName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod)) if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.CurrentDeg.Deg.ShrtName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentDeg.Deg.ShrtName); Txt_The_degree_X_already_exists,
Gbl.CurrentDeg.Deg.ShrtName);
} }
else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Gbl.CurrentDeg.Deg.FullName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod)) else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Gbl.CurrentDeg.Deg.FullName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentDeg.Deg.FullName); Txt_The_degree_X_already_exists,
Gbl.CurrentDeg.Deg.FullName);
} }
else else
{ {
@ -2077,9 +2088,10 @@ void Deg_ChangeDegCtrInConfig (void)
/***** Create message to show the change made *****/ /***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_has_been_moved_to_the_centre_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentDeg.Deg.FullName, Txt_The_degree_X_has_been_moved_to_the_centre_Y,
Gbl.CurrentCtr.Ctr.FullName); Gbl.CurrentDeg.Deg.FullName,
Gbl.CurrentCtr.Ctr.FullName);
} }
} }
} }
@ -2142,7 +2154,9 @@ void Deg_ChangeDegWWW (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to degree changed *****/ and put button to go to degree changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Deg_ShowAlertAndButtonToGoToDeg (); Deg_ShowAlertAndButtonToGoToDeg ();
} }
else else
@ -2171,7 +2185,9 @@ void Deg_ChangeDegWWWInConfig (void)
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2234,8 +2250,9 @@ void Deg_ChangeDegStatus (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to degree changed *****/ and put button to go to degree changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_degree_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingDeg.ShrtName); Txt_The_status_of_the_degree_X_has_changed,
Gbl.Degs.EditingDeg.ShrtName);
Deg_ShowAlertAndButtonToGoToDeg (); Deg_ShowAlertAndButtonToGoToDeg ();
/***** Show the form again *****/ /***** Show the form again *****/

View File

@ -551,8 +551,9 @@ static void DT_CreateDegreeType (struct DegreeType *DegTyp)
DB_QueryINSERT (Query,"can not create a new type of degree"); DB_QueryINSERT (Query,"can not create a new type of degree");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_type_of_degree_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
DegTyp->DegTypName); Txt_Created_new_type_of_degree_X,
DegTyp->DegTypName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -720,8 +721,9 @@ void DT_RecFormNewDegreeType (void)
/***** If name of degree type was in database... *****/ /***** If name of degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (DegTyp->DegTypName,-1L)) if (DT_CheckIfDegreeTypeNameExists (DegTyp->DegTypName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
DegTyp->DegTypName); Txt_The_type_of_degree_X_already_exists,
DegTyp->DegTypName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new degree type to database else // Add new degree type to database
@ -760,8 +762,9 @@ void DT_RemoveDegreeType (void)
DT_RemoveDegreeTypeCompletely (DegTyp.DegTypCod); DT_RemoveDegreeTypeCompletely (DegTyp.DegTypCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Type_of_degree_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
DegTyp.DegTypName); Txt_Type_of_degree_X_removed,
DegTyp.DegTypName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -934,8 +937,9 @@ void DT_RenameDegreeType (void)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewNameDegTyp[0]) if (!NewNameDegTyp[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
DegTyp->DegTypName); Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
DegTyp->DegTypName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -946,8 +950,9 @@ void DT_RenameDegreeType (void)
/***** If degree type was in database... *****/ /***** If degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (NewNameDegTyp,DegTyp->DegTypCod)) if (DT_CheckIfDegreeTypeNameExists (NewNameDegTyp,DegTyp->DegTypCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNameDegTyp); Txt_The_type_of_degree_X_already_exists,
NewNameDegTyp);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -959,15 +964,17 @@ void DT_RenameDegreeType (void)
DB_QueryUPDATE (Query,"can not update the type of a degree"); DB_QueryUPDATE (Query,"can not update the type of a degree");
/* Write message to show the change made */ /* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
DegTyp->DegTypName,NewNameDegTyp); Txt_The_type_of_degree_X_has_been_renamed_as_Y,
DegTyp->DegTypName,NewNameDegTyp);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_type_of_degree_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNameDegTyp); Txt_The_name_of_the_type_of_degree_X_has_not_changed,
NewNameDegTyp);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -1021,8 +1028,9 @@ void DT_ChangeDegreeType (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to degree changed *****/ and put button to go to degree changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_of_the_degree_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Degs.EditingDeg.FullName); Txt_The_type_of_degree_of_the_degree_X_has_changed,
Gbl.Degs.EditingDeg.FullName);
Deg_ShowAlertAndButtonToGoToDeg (); Deg_ShowAlertAndButtonToGoToDeg ();
/***** Show the form again *****/ /***** Show the form again *****/

View File

@ -628,7 +628,9 @@ void Dpt_RemoveDepartment (void)
DB_QueryDELETE (Query,"can not remove a department"); DB_QueryDELETE (Query,"can not remove a department");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Department_X_removed,Dpt.FullName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Department_X_removed,
Dpt.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -732,8 +734,9 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewDptName[0]) if (!NewDptName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_department_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentDptName); Txt_You_can_not_leave_the_name_of_the_department_X_empty,
CurrentDptName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -744,8 +747,9 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If degree was in database... *****/ /***** If degree was in database... *****/
if (Dpt_CheckIfDepartmentNameExists (ParamName,NewDptName,Dpt->DptCod)) if (Dpt_CheckIfDepartmentNameExists (ParamName,NewDptName,Dpt->DptCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewDptName); Txt_The_department_X_already_exists,
NewDptName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -754,15 +758,17 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
Dpt_UpdateDegNameDB (Dpt->DptCod,FieldName,NewDptName); Dpt_UpdateDegNameDB (Dpt->DptCod,FieldName,NewDptName);
/* Write message to show the change made */ /* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_department_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentDptName,NewDptName); Txt_The_department_X_has_been_renamed_as_Y,
CurrentDptName,NewDptName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_department_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentDptName); Txt_The_name_of_the_department_X_has_not_changed,
CurrentDptName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -832,8 +838,9 @@ void Dpt_ChangeDptWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a department"); DB_QueryUPDATE (Query,"can not update the web of a department");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewWWW); Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -1021,14 +1028,16 @@ void Dpt_RecFormNewDpt (void)
/***** If name of department was in database... *****/ /***** If name of department was in database... *****/
if (Dpt_CheckIfDepartmentNameExists ("ShortName",Dpt->ShrtName,-1L)) if (Dpt_CheckIfDepartmentNameExists ("ShortName",Dpt->ShrtName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Dpt->ShrtName); Txt_The_department_X_already_exists,
Dpt->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Dpt_CheckIfDepartmentNameExists ("FullName",Dpt->FullName,-1L)) else if (Dpt_CheckIfDepartmentNameExists ("FullName",Dpt->FullName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Dpt->FullName); Txt_The_department_X_already_exists,
Dpt->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new department to database else // Add new department to database
@ -1065,8 +1074,9 @@ static void Dpt_CreateDepartment (struct Department *Dpt)
DB_QueryINSERT (Query,"can not create a new department"); DB_QueryINSERT (Query,"can not create a new department");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_department_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Dpt->FullName); Txt_Created_new_department_X,
Dpt->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -360,12 +360,13 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncParams)
Act_StartForm (NextAction); Act_StartForm (NextAction);
if (FuncParams) if (FuncParams)
FuncParams (); FuncParams ();
fprintf (Gbl.F.Out,"<label class=\"%s RIGHT_MIDDLE\">" fprintf (Gbl.F.Out,"<label for=\"OtherUsrIDNickOrEMail\""
" class=\"%s RIGHT_MIDDLE\">"
"%s:&nbsp;" "%s:&nbsp;"
"<input type=\"text\" name=\"OtherUsrIDNickOrEMail\"" "</label>"
" size=\"18\" maxlength=\"%u\"" "<input type=\"text\" id=\"OtherUsrIDNickOrEMail\""
" required=\"required\" />" " name=\"OtherUsrIDNickOrEMail\""
"</label>", " size=\"18\" maxlength=\"%u\" required=\"required\" />",
The_ClassForm[Gbl.Prefs.Theme], The_ClassForm[Gbl.Prefs.Theme],
Txt_nick_email_or_ID, Txt_nick_email_or_ID,
Cns_MAX_CHARS_EMAIL_ADDRESS); Cns_MAX_CHARS_EMAIL_ADDRESS);
@ -394,9 +395,10 @@ void Enr_ReqAcceptRegisterInCrs (void)
Hlp_USERS_SignUp_confirm_enrolment,Box_NOT_CLOSABLE); Hlp_USERS_SignUp_confirm_enrolment,Box_NOT_CLOSABLE);
/***** Show message *****/ /***** Show message *****/
sprintf (Gbl.Alert.Txt,Txt_A_teacher_or_administrator_has_enroled_you_as_X_into_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex], Txt_A_teacher_or_administrator_has_enroled_you_as_X_into_the_course_Y,
Gbl.CurrentCrs.Crs.FullName); Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Send button to accept register in the current course *****/ /***** Send button to accept register in the current course *****/
@ -772,8 +774,9 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
else else
{ {
/* Write help message */ /* Write help message */
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X_Therefore_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName); Txt_No_groups_have_been_created_in_the_course_X_Therefore_,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -895,10 +898,11 @@ void Enr_RemoveOldUsrs (void)
(unsigned long) SecondsWithoutAccess); (unsigned long) SecondsWithoutAccess);
if ((NumUsrs = DB_QuerySELECT (Query,&mysql_res,"can not get old users"))) if ((NumUsrs = DB_QuerySELECT (Query,&mysql_res,"can not get old users")))
{ {
sprintf (Gbl.Alert.Txt,Txt_Eliminating_X_users_who_were_not_enroled_in_any_course_and_with_more_than_Y_months_without_access_to_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumUsrs, Txt_Eliminating_X_users_who_were_not_enroled_in_any_course_and_with_more_than_Y_months_without_access_to_Z,
MonthsWithoutAccess, NumUsrs,
Cfg_PLATFORM_SHORT_NAME); MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
@ -929,8 +933,9 @@ void Enr_RemoveOldUsrs (void)
} }
/***** Write end message *****/ /***** Write end message *****/
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_eliminated, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumUsrsEliminated); Txt_X_users_have_been_eliminated,
NumUsrsEliminated);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1027,15 +1032,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
Gbl.Usrs.Me.Role.Logged >= Rol_STD) Gbl.Usrs.Me.Role.Logged >= Rol_STD)
{ {
sprintf (Gbl.Alert.Txt,UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
Txt_Modify_user_in_the_course_X) :
(ItsMe ? Txt_Register_me_in_X :
Txt_Register_USER_in_the_course_X),
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS,
(unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS); (unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1043,10 +1043,16 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
Txt_Modify_user_in_the_course_X) :
(ItsMe ? Txt_Register_me_in_X :
Txt_Register_USER_in_the_course_X),
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1060,12 +1066,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsDegAdmin && if (!UsrIsDegAdmin &&
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
{ {
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN,
(unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN); (unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1073,10 +1077,13 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); Txt_Register_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1085,12 +1092,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsCtrAdmin && if (!UsrIsCtrAdmin &&
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)
{ {
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN,
(unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN); (unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1098,10 +1103,13 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); Txt_Register_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1111,12 +1119,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsInsAdmin && if (!UsrIsInsAdmin &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
{ {
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN,
(unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN); (unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1124,10 +1130,12 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN);
"</li>", fprintf (Gbl.F.Out,Txt_Register_USER_as_an_administrator_of_the_institution_X,
Gbl.Alert.Txt); Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1137,9 +1145,9 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!ItsMe && Gbl.Usrs.Me.Role.Logged >= Rol_TCH) if (!ItsMe && Gbl.Usrs.Me.Role.Logged >= Rol_TCH)
{ {
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE,
(unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE); (unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1147,9 +1155,11 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>", "</li>",
(unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE,
Txt_Report_possible_duplicate_user); Txt_Report_possible_duplicate_user);
NumOptionsShown++; NumOptionsShown++;
@ -1158,14 +1168,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
/***** Remove user from the course *****/ /***** Remove user from the course *****/
if (UsrBelongsToCrs) if (UsrBelongsToCrs)
{ {
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_from_THE_COURSE_X :
Txt_Remove_USER_from_THE_COURSE_X,
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\%u\"",
" value=\"%u\"", (unsigned) Enr_REMOVE_ONE_USR_FROM_CRS,
(unsigned) Enr_REMOVE_ONE_USR_FROM_CRS); (unsigned) Enr_REMOVE_ONE_USR_FROM_CRS);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1173,10 +1179,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REMOVE_ONE_USR_FROM_CRS);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); ItsMe ? Txt_Remove_me_from_THE_COURSE_X :
Txt_Remove_USER_from_THE_COURSE_X,
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1190,14 +1200,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsDegAdmin && if (UsrIsDegAdmin &&
(ItsMe || Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)) (ItsMe || Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM))
{ {
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_degree_X :
Txt_Remove_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\" "
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN,
(unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN); (unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1205,10 +1211,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); ItsMe ? Txt_Remove_me_as_an_administrator_of_the_degree_X :
Txt_Remove_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1217,14 +1227,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsCtrAdmin && if (UsrIsCtrAdmin &&
(ItsMe || Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)) (ItsMe || Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM))
{ {
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_centre_X :
Txt_Remove_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN,
(unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN); (unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1232,10 +1238,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); ItsMe ? Txt_Remove_me_as_an_administrator_of_the_centre_X :
Txt_Remove_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1245,14 +1255,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsInsAdmin && if (UsrIsInsAdmin &&
(ItsMe || Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)) (ItsMe || Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM))
{ {
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_institution_X :
Txt_Remove_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN,
(unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN); (unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN);
if (!OptionChecked) if (!OptionChecked)
{ {
@ -1260,10 +1266,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true; OptionChecked = true;
} }
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "<label for=\"RegRemAction%u\">",
"</label>" (unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN);
"</li>", fprintf (Gbl.F.Out,
Gbl.Alert.Txt); ItsMe ? Txt_Remove_me_as_an_administrator_of_the_institution_X :
Txt_Remove_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++; NumOptionsShown++;
} }
@ -1273,16 +1283,18 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (Acc_CheckIfICanEliminateAccount (Gbl.Usrs.Other.UsrDat.UsrCod)) if (Acc_CheckIfICanEliminateAccount (Gbl.Usrs.Other.UsrDat.UsrCod))
{ {
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\"",
" value=\"%u\"", (unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM); (unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);
if (!OptionChecked) if (!OptionChecked)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>", "</li>",
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM,
ItsMe ? Txt_Eliminate_my_user_account : ItsMe ? Txt_Eliminate_my_user_account :
Txt_Eliminate_user_account); Txt_Eliminate_user_account);
@ -1316,52 +1328,62 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
/***** Register / remove users listed or not listed *****/ /***** Register / remove users listed or not listed *****/
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\" checked=\"checked\" />"
" value=\"%u\" checked=\"checked\" />" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>" "</li>"
"<li>" "<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\" />"
" value=\"%u\" />" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>" "</li>"
"<li>" "<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\" />"
" value=\"%u\" />" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>" "</li>"
"<li>" "<li>"
"<label>" "<input id=\"RegRemAction%u\" type=\"radio\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\" />"
" value=\"%u\" />" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>", "</li>",
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS, (unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1, Txt_Register_the_users_indicated_in_step_1,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS, (unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_indicated_in_step_1, Txt_Remove_the_users_indicated_in_step_1,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS, (unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_not_indicated_in_step_1, Txt_Remove_the_users_not_indicated_in_step_1,
(unsigned) Enr_UPDATE_USRS_IN_CRS, (unsigned) Enr_UPDATE_USRS_IN_CRS,
(unsigned) Enr_UPDATE_USRS_IN_CRS,
(unsigned) Enr_UPDATE_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated); Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated);
/***** Only for superusers *****/ /***** Only for superusers *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
fprintf (Gbl.F.Out,"<li>" fprintf (Gbl.F.Out,"<li>"
"<label>" "<input type=\"radio\" id=\"RegRemAction%u\""
"<input type=\"radio\" name=\"RegRemAction\"" " name=\"RegRemAction\" value=\"%u\" />"
" value=\"%u\" />" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>"
"</li>", "</li>",
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM, (unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
Txt_Eliminate_from_the_platform_the_users_indicated_in_step_1); Txt_Eliminate_from_the_platform_the_users_indicated_in_step_1);
/***** End list of options *****/ /***** End list of options *****/
@ -1757,8 +1779,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_eliminated); Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_eliminated);
break; break;
default: default:
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_eliminated, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumUsrsEliminated); Txt_X_users_have_been_eliminated,
NumUsrsEliminated);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
break; break;
} }
@ -1772,8 +1795,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_removed); Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_removed);
break; break;
default: default:
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumUsrsRemoved); Txt_X_users_have_been_removed,
NumUsrsRemoved);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
break; break;
} }
@ -1788,8 +1812,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_enroled); Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_enroled);
break; break;
default: default:
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_enroled_including_possible_repetitions, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumUsrsRegistered); Txt_X_users_have_been_enroled_including_possible_repetitions,
NumUsrsRegistered);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
break; break;
} }
@ -1886,9 +1911,10 @@ void Enr_AskRemAllStdsThisCrs (void)
{ {
/***** Show question and button to remove students *****/ /***** Show question and button to remove students *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD], Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
Gbl.CurrentCrs.Crs.FullName); Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show form to request confirmation */ /* Show form to request confirmation */
@ -1922,8 +1948,9 @@ void Enr_RemAllStdsThisCrs (void)
{ {
if ((NumStdsInCrs = Enr_RemAllStdsInCrs (&Gbl.CurrentCrs.Crs))) if ((NumStdsInCrs = Enr_RemAllStdsInCrs (&Gbl.CurrentCrs.Crs)))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_X_students_who_belonged_to_the_course_Y_have_been_removed_from_it, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumStdsInCrs,Gbl.CurrentCrs.Crs.FullName); Txt_The_X_students_who_belonged_to_the_course_Y_have_been_removed_from_it,
NumStdsInCrs,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else // NumStdsInCrs == 0 else // NumStdsInCrs == 0
@ -1975,9 +2002,10 @@ void Enr_ReqSignUpInCrs (void)
/***** Check if I already belong to course *****/ /***** Check if I already belong to course *****/
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role >= Rol_STD) if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role >= Rol_STD)
{ {
sprintf (Gbl.Alert.Txt,Txt_You_were_already_enroled_as_X_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex], Txt_You_were_already_enroled_as_X_in_the_course_Y,
Gbl.CurrentCrs.Crs.FullName); Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Gbl.Usrs.Me.Role.Logged == Rol_GST || else if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
@ -2006,9 +2034,10 @@ void Enr_SignUpInCrs (void)
/***** Check if I already belong to course *****/ /***** Check if I already belong to course *****/
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role >= Rol_STD) if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role >= Rol_STD)
{ {
sprintf (Gbl.Alert.Txt,Txt_You_were_already_enroled_as_X_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex], Txt_You_were_already_enroled_as_X_in_the_course_Y,
Gbl.CurrentCrs.Crs.FullName); Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -2064,9 +2093,10 @@ void Enr_SignUpInCrs (void)
} }
/***** Show confirmation message *****/ /***** Show confirmation message *****/
sprintf (Gbl.Alert.Txt,Txt_Your_request_for_enrolment_as_X_in_the_course_Y_has_been_accepted_for_processing, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ROLES_SINGUL_abc[RoleFromForm][Gbl.Usrs.Me.UsrDat.Sex], Txt_Your_request_for_enrolment_as_X_in_the_course_Y_has_been_accepted_for_processing,
Gbl.CurrentCrs.Crs.FullName); Txt_ROLES_SINGUL_abc[RoleFromForm][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Notify teachers or admins by email about the new enrolment request *****/ /***** Notify teachers or admins by email about the new enrolment request *****/
@ -2159,8 +2189,9 @@ void Enr_AskIfRejectSignUp (void)
if (Usr_CheckIfUsrBelongsToCurrentCrs (&Gbl.Usrs.Other.UsrDat)) if (Usr_CheckIfUsrBelongsToCurrentCrs (&Gbl.Usrs.Other.UsrDat))
{ {
/* User already belongs to this course */ /* User already belongs to this course */
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -2176,10 +2207,11 @@ void Enr_AskIfRejectSignUp (void)
{ {
/***** Show question and button to reject user's enrolment request *****/ /***** Show question and button to reject user's enrolment request *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reject_the_enrolment_request_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName, Txt_Do_you_really_want_to_reject_the_enrolment_request_,
Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Other.UsrDat.Sex], Gbl.Usrs.Other.UsrDat.FullName,
Gbl.CurrentCrs.Crs.FullName); Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Other.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show user's record */ /* Show user's record */
@ -2216,8 +2248,9 @@ void Enr_RejectSignUp (void)
if (Usr_CheckIfUsrBelongsToCurrentCrs (&Gbl.Usrs.Other.UsrDat)) if (Usr_CheckIfUsrBelongsToCurrentCrs (&Gbl.Usrs.Other.UsrDat))
{ {
/* User already belongs to this course */ /* User already belongs to this course */
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
} }
@ -2226,8 +2259,9 @@ void Enr_RejectSignUp (void)
Enr_RemoveEnrolmentRequest (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Other.UsrDat.UsrCod); Enr_RemoveEnrolmentRequest (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Other.UsrDat.UsrCod);
/* Confirmation message */ /* Confirmation message */
sprintf (Gbl.Alert.Txt,Txt_Enrolment_of_X_rejected, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName); Txt_Enrolment_of_X_rejected,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -3254,8 +3288,9 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
/***** Warning if more than one user found *****/ /***** Warning if more than one user found *****/
if (ListUsrCods->NumUsrs > 1) if (ListUsrCods->NumUsrs > 1)
{ {
sprintf (Gbl.Alert.Txt,Txt_There_are_X_users_with_the_ID_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ListUsrCods->NumUsrs,Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail); Txt_There_are_X_users_with_the_ID_Y,
ListUsrCods->NumUsrs,Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
@ -3275,19 +3310,23 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
{ {
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat); Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
if (Gbl.Usrs.Other.UsrDat.Accepted) if (Gbl.Usrs.Other.UsrDat.Accepted)
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
else // Enrolment not yet accepted else // Enrolment not yet accepted
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_in_the_course_Y_but_has_not_yet_accepted_the_enrolment, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_is_already_in_the_course_Y_but_has_not_yet_accepted_the_enrolment,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr (); Enr_ShowFormToEditOtherUsr ();
} }
else // User does not belong to the current course else // User does not belong to the current course
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_already_exists_in_Y_but_is_not_yet_enroled_in_the_course_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Cfg_PLATFORM_SHORT_NAME,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_already_exists_in_Y_but_is_not_yet_enroled_in_the_course_Z,
Gbl.Usrs.Other.UsrDat.FullName,
Cfg_PLATFORM_SHORT_NAME,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr (); Enr_ShowFormToEditOtherUsr ();
@ -3295,8 +3334,9 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
} }
else // No course selected else // No course selected
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_already_exists_in_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Cfg_PLATFORM_SHORT_NAME); Txt_THE_USER_X_already_exists_in_Y,
Gbl.Usrs.Other.UsrDat.FullName,Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr (); Enr_ShowFormToEditOtherUsr ();
@ -3318,16 +3358,18 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
if (NewUsrIDValid) if (NewUsrIDValid)
{ {
/***** Show form to enter the data of a new user *****/ /***** Show form to enter the data of a new user *****/
sprintf (Gbl.Alert.Txt,Txt_The_user_is_new_not_yet_in_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cfg_PLATFORM_SHORT_NAME); Txt_The_user_is_new_not_yet_in_X,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Rec_ShowFormOtherNewSharedRecord (&Gbl.Usrs.Other.UsrDat,Role); Rec_ShowFormOtherNewSharedRecord (&Gbl.Usrs.Other.UsrDat,Role);
} }
else // User's ID is not valid else // User's ID is not valid
{ {
/* Write message and request a new user's ID */ /* Write message and request a new user's ID */
sprintf (Gbl.Alert.Txt,Txt_If_this_is_a_new_user_in_X_you_should_indicate_her_his_ID, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cfg_PLATFORM_SHORT_NAME); Txt_If_this_is_a_new_user_in_X_you_should_indicate_her_his_ID,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Enr_ReqRegRemUsr (Role); Enr_ReqRegRemUsr (Role);
} }
@ -3420,8 +3462,9 @@ static void Enr_RegisterAdmin (struct UsrData *UsrDat,Sco_Scope_t Scope,long Cod
/***** Check if user was and administrator of current institution/centre/degree *****/ /***** Check if user was and administrator of current institution/centre/degree *****/
if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,Scope,Cod)) if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,Scope,Cod))
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_an_administrator_of_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,InsCtrDegName); Txt_THE_USER_X_is_already_an_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
else // User was not administrator of current institution/centre/degree else // User was not administrator of current institution/centre/degree
{ {
/***** Insert or replace administrator in current institution/centre/degree *****/ /***** Insert or replace administrator in current institution/centre/degree *****/
@ -3432,8 +3475,9 @@ static void Enr_RegisterAdmin (struct UsrData *UsrDat,Sco_Scope_t Scope,long Cod
UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod); UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod);
DB_QueryREPLACE (Query,"can not create administrator"); DB_QueryREPLACE (Query,"can not create administrator");
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_as_administrator_of_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,InsCtrDegName); Txt_THE_USER_X_has_been_enroled_as_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
} }
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -3632,8 +3676,9 @@ static void Enr_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr,Sco_Scope_t
} }
else // The other user is not an administrator of current institution else // The other user is not an administrator of current institution
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_an_administrator_of_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName); Txt_THE_USER_X_is_not_an_administrator_of_Y,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
@ -3680,8 +3725,9 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
{ {
if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod)) // User is already an administrator of current institution/centre/degree if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod)) // User is already an administrator of current institution/centre/degree
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_an_administrator_of_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName); Txt_THE_USER_X_is_already_an_administrator_of_Y,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
} }
@ -3689,8 +3735,9 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
{ {
/***** Show question and button to register user as administrator *****/ /***** Show question and button to register user as administrator *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
InsCtrDegName); Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
InsCtrDegName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show user's record */ /* Show user's record */
@ -3729,8 +3776,9 @@ void Enr_AcceptRegisterMeInCrs (void)
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Confirmation message *****/ /***** Confirmation message *****/
sprintf (Gbl.Alert.Txt,Txt_You_have_confirmed_your_enrolment_in_the_course_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName); Txt_You_have_confirmed_your_enrolment_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -3781,10 +3829,12 @@ void Enr_CreateNewUsr1 (void)
/* Success message */ /* Success message */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName, Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex], Gbl.Usrs.Other.UsrDat.FullName,
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]); Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]);
} }
} }
else // User does not belong to current course else // User does not belong to current course
@ -3795,8 +3845,10 @@ void Enr_CreateNewUsr1 (void)
/* Success message */ /* Success message */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,
Gbl.CurrentCrs.Crs.FullName);
} }
/***** Change user's groups *****/ /***** Change user's groups *****/
@ -3829,8 +3881,9 @@ void Enr_CreateNewUsr1 (void)
{ {
/***** Error message *****/ /***** Error message *****/
Gbl.Alert.Type = Ale_ERROR; Gbl.Alert.Type = Ale_ERROR;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.IDs.List[0].ID); Txt_The_ID_X_is_not_valid,
Gbl.Usrs.Other.UsrDat.IDs.List[0].ID);
} }
} }
@ -3904,10 +3957,12 @@ void Enr_ModifyUsr1 (void)
/* Set success message */ /* Set success message */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName, Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex], Gbl.Usrs.Other.UsrDat.FullName,
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]); Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]);
} }
} }
else // User does not belong to current course else // User does not belong to current course
@ -3918,8 +3973,9 @@ void Enr_ModifyUsr1 (void)
/* Set success message */ /* Set success message */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName); Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
} }
/***** Change user's groups *****/ /***** Change user's groups *****/
@ -4097,10 +4153,10 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat)
/***** Show question and button to remove user as administrator *****/ /***** Show question and button to remove user as administrator *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ItsMe ? Txt_Do_you_really_want_to_be_removed_from_the_course_X : ItsMe ? Txt_Do_you_really_want_to_be_removed_from_the_course_X :
Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_X, Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_X,
Gbl.CurrentCrs.Crs.FullName); Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show user's record */ /* Show user's record */
@ -4216,8 +4272,9 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,struct Course *
if (QuietOrVerbose == Cns_VERBOSE) if (QuietOrVerbose == Cns_VERBOSE)
{ {
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_the_course_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,Crs->FullName); Txt_THE_USER_X_has_been_removed_from_the_course_Y,
UsrDat->FullName,Crs->FullName);
} }
} }
else // User does not belong to course else // User does not belong to course
@ -4255,10 +4312,10 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,
{ {
/***** Show question and button to remove user as administrator *****/ /***** Show question and button to remove user as administrator *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ItsMe ? Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_X : ItsMe ? Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_X :
Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_X, Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_X,
InsCtrDegName); InsCtrDegName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show user's record */ /* Show user's record */
@ -4295,14 +4352,16 @@ static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope,
UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod); UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod);
DB_QueryDELETE (Query,"can not remove an administrator"); DB_QueryDELETE (Query,"can not remove an administrator");
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator_of_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,InsCtrDegName); Txt_THE_USER_X_has_been_removed_as_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else // User is not an administrator of the current institution/centre/degree else // User is not an administrator of the current institution/centre/degree
{ {
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_an_administrator_of_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,InsCtrDegName); Txt_THE_USER_X_is_not_an_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
} }

View File

@ -658,8 +658,9 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx
/***** The result of the query may be empty *****/ /***** The result of the query may be empty *****/
if (!NumExaAnns) if (!NumExaAnns)
{ {
sprintf (Gbl.Alert.Txt,Txt_No_announcements_of_exams_of_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName); Txt_No_announcements_of_exams_of_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }

View File

@ -141,11 +141,13 @@ bool Fil_ReadStdinIntoTmpFile (void)
{ {
Fil_EndOfReadingStdin (); // If stdin were not fully read, there will be problems with buffers Fil_EndOfReadingStdin (); // If stdin were not fully read, there will be problems with buffers
if (FileIsTooBig) if (FileIsTooBig)
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_File_too_large_maximum_X_MiB_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned long) (Fil_MAX_FILE_SIZE / (1024ULL * 1024ULL))); Txt_UPLOAD_FILE_File_too_large_maximum_X_MiB_NO_HTML,
(unsigned long) (Fil_MAX_FILE_SIZE / (1024ULL * 1024ULL)));
else else
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_Upload_time_too_long_maximum_X_minutes_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned long) (Cfg_TIME_TO_ABORT_FILE_UPLOAD / 60UL)); Txt_UPLOAD_FILE_Upload_time_too_long_maximum_X_minutes_NO_HTML,
(unsigned long) (Cfg_TIME_TO_ABORT_FILE_UPLOAD / 60UL));
/* Don't write HTML at all */ /* Don't write HTML at all */
Gbl.Layout.HTMLStartWritten = Gbl.Layout.HTMLStartWritten =
@ -341,7 +343,9 @@ void Fil_CreateUpdateFile (const char CurrentName[PATH_MAX + 1],
/* Open the new file */ /* Open the new file */
if ((*NewFile = fopen (NewName,"wb")) == NULL) if ((*NewFile = fopen (NewName,"wb")) == NULL)
{ {
sprintf (Gbl.Alert.Txt,"Can not create file <strong>%s</strong>.",NewName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not create file <strong>%s</strong>.",
NewName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
} }
@ -358,14 +362,16 @@ void Fil_CloseUpdateFile (const char *CurrentName,const char *OldName,const char
/* Rename the old file and the new file */ /* Rename the old file and the new file */
if (rename (CurrentName,OldName)) // mv CurrentName OldName Ej: mv file.html file.old if (rename (CurrentName,OldName)) // mv CurrentName OldName Ej: mv file.html file.old
{ {
sprintf (Gbl.Alert.Txt,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentName,OldName); "Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
CurrentName,OldName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
if (rename (NewName,CurrentName)) // mv NewName CurrentName Ej: mv file.new file.html if (rename (NewName,CurrentName)) // mv NewName CurrentName Ej: mv file.new file.html
{ {
sprintf (Gbl.Alert.Txt,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewName,CurrentName); "Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
NewName,CurrentName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
} }
@ -386,12 +392,14 @@ bool Fil_RenameFileOrDir (const char *PathOld,const char *PathNew)
{ {
case ENOTEMPTY: case ENOTEMPTY:
case EEXIST: case EEXIST:
sprintf (Gbl.Alert.Txt,Txt_There_is_already_a_non_empty_folder_named_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
PathNew); Txt_There_is_already_a_non_empty_folder_named_X,
PathNew);
break; break;
case ENOTDIR: case ENOTDIR:
sprintf (Gbl.Alert.Txt,Txt_There_is_already_a_file_named_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
PathNew); Txt_There_is_already_a_file_named_X,
PathNew);
break; break;
case EACCES: case EACCES:
Lay_ShowErrorAndExit ("Write is forbidden."); Lay_ShowErrorAndExit ("Write is forbidden.");
@ -426,7 +434,9 @@ void Fil_CreateDirIfNotExists (const char *Path)
if (!Fil_CheckIfPathExists (Path)) if (!Fil_CheckIfPathExists (Path))
if (mkdir (Path,(mode_t) 0xFFF) != 0) if (mkdir (Path,(mode_t) 0xFFF) != 0)
{ {
sprintf (Gbl.Alert.Txt,"Can not create folder <strong>%s</strong>.",Path); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not create folder <strong>%s</strong>.",
Path);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
} }
@ -485,7 +495,9 @@ void Fil_RemoveTree (const char *Path)
Error = true; Error = true;
if (Error) if (Error)
{ {
sprintf (Gbl.Alert.Txt,"Can not remove folder %s.",Path); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not remove folder %s.",
Path);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
} }

View File

@ -3124,12 +3124,13 @@ bool Brw_UpdateFoldersAssigmentsIfExistForAllUsrs (const char *OldFolderName,con
} }
/***** Summary message *****/ /***** Summary message *****/
sprintf (Gbl.Alert.Txt,"%s: %u<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %u<br />" "%s: %u<br />"
"%s: %u.", "%s: %u<br />"
Txt_Users,NumUsrs, "%s: %u.",
Txt_Folders_renamed,NumUsrsSuccess, Txt_Users,NumUsrs,
Txt_Folders_not_renamed,NumUsrsError); Txt_Folders_renamed,NumUsrsSuccess,
Txt_Folders_not_renamed,NumUsrsError);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else else
@ -3816,9 +3817,10 @@ void Brw_ShowAgainFileBrowserOrWorks (void)
} }
/***** Legal notice *****/ /***** Legal notice *****/
sprintf (Gbl.Alert.Txt,Txt_Disclaimer_the_files_hosted_here_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cfg_PLATFORM_SHORT_NAME, Txt_Disclaimer_the_files_hosted_here_,
Cfg_PLATFORM_RESPONSIBLE_EMAIL); Cfg_PLATFORM_SHORT_NAME,
Cfg_PLATFORM_RESPONSIBLE_EMAIL);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
@ -7027,8 +7029,9 @@ void Brw_AskRemFileFromTree (void)
Gbl.FileBrowser.FileType, Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName, Gbl.FileBrowser.FilFolLnkName,
FileNameToShow); FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_FILE_OR_LINK_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_Do_you_really_want_to_remove_FILE_OR_LINK_X,
FileNameToShow);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
Brw_ActRemoveFile[Gbl.FileBrowser.Type],NULL,NULL, Brw_ActRemoveFile[Gbl.FileBrowser.Type],NULL,NULL,
Brw_PutParamsRemFile, Brw_PutParamsRemFile,
@ -7096,7 +7099,9 @@ void Brw_RemFileFromTree (void)
Gbl.Usrs.Other.UsrDat.UsrCod); Gbl.Usrs.Other.UsrDat.UsrCod);
/* Message of confirmation of removing */ /* Message of confirmation of removing */
sprintf (Gbl.Alert.Txt,Txt_FILE_X_removed,FileNameToShow); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_FILE_X_removed,
FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else // File / link not found else // File / link not found
@ -7152,8 +7157,9 @@ void Brw_RemFolderFromTree (void)
Gbl.Usrs.Other.UsrDat.UsrCod); Gbl.Usrs.Other.UsrDat.UsrCod);
/* Message of confirmation of successfull removing */ /* Message of confirmation of successfull removing */
sprintf (Gbl.Alert.Txt,Txt_Folder_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName); Txt_Folder_X_removed,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else // Folder not found else // Folder not found
@ -7176,8 +7182,9 @@ static void Brw_AskConfirmRemoveFolderNotEmpty (void)
extern const char *Txt_Remove_folder; extern const char *Txt_Remove_folder;
/***** Show question and button to remove not empty folder *****/ /***** Show question and button to remove not empty folder *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName); Txt_Do_you_really_want_to_remove_the_folder_X,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
Brw_ActRemoveFolderNotEmpty[Gbl.FileBrowser.Type],NULL,NULL, Brw_ActRemoveFolderNotEmpty[Gbl.FileBrowser.Type],NULL,NULL,
Brw_PutParamsRemFolder, Brw_PutParamsRemFolder,
@ -7230,8 +7237,9 @@ void Brw_RemSubtreeInFileBrowser (void)
Brw_RemoveAffectedExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree); Brw_RemoveAffectedExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree);
/***** Write message of confirmation *****/ /***** Write message of confirmation *****/
sprintf (Gbl.Alert.Txt,Txt_Folder_X_and_all_its_contents_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName); Txt_Folder_X_and_all_its_contents_removed,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -7523,16 +7531,18 @@ static void Brw_WriteCurrentClipboard (void)
Gbl.FileBrowser.Clipboard.FileName, Gbl.FileBrowser.Clipboard.FileName,
FileNameToShow); FileNameToShow);
sprintf (Gbl.Alert.Txt,"%s: %s, %s <strong>%s</strong>.", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Copy_source,TxtClipboardZone, "%s: %s, %s <strong>%s</strong>.",
TxtFileType[Gbl.FileBrowser.Clipboard.FileType], Txt_Copy_source,TxtClipboardZone,
FileNameToShow); TxtFileType[Gbl.FileBrowser.Clipboard.FileType],
FileNameToShow);
} }
else else
// The root folder // The root folder
sprintf (Gbl.Alert.Txt,"%s: %s, %s.", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Copy_source,TxtClipboardZone, "%s: %s, %s.",
Txt_all_files_inside_the_root_folder); Txt_Copy_source,TxtClipboardZone,
Txt_all_files_inside_the_root_folder);
Ale_ShowAlert (Ale_CLIPBOARD,Gbl.Alert.Txt); Ale_ShowAlert (Ale_CLIPBOARD,Gbl.Alert.Txt);
} }
@ -8434,14 +8444,15 @@ static void Brw_PasteClipboard (void)
&FirstFilCod)) &FirstFilCod))
{ {
/***** Write message of success *****/ /***** Write message of success *****/
sprintf (Gbl.Alert.Txt,"%s<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %u<br />" "%s<br />"
"%s: %u<br />" "%s: %u<br />"
"%s: %u", "%s: %u<br />"
Txt_The_copy_has_been_successful, "%s: %u",
Txt_Files_copied ,Pasted.NumFiles, Txt_The_copy_has_been_successful,
Txt_Links_copied ,Pasted.NumLinks, Txt_Files_copied ,Pasted.NumFiles,
Txt_Folders_copied,Pasted.NumFolds); Txt_Links_copied ,Pasted.NumLinks,
Txt_Folders_copied,Pasted.NumFolds);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Notify new files *****/ /***** Notify new files *****/
@ -8582,16 +8593,19 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
switch (FileType) switch (FileType)
{ {
case Brw_IS_FILE: case Brw_IS_FILE:
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_maximum_allowed_number_of_levels, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
FileNameToShow);
break; break;
case Brw_IS_FOLDER: case Brw_IS_FOLDER:
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_maximum_allowed_number_of_levels, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
FileNameToShow);
break; break;
case Brw_IS_LINK: case Brw_IS_LINK:
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_maximum_allowed_number_of_levels, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
FileNameToShow);
break; break;
default: default:
Lay_ShowErrorAndExit ("Can not paste unknown file type."); Lay_ShowErrorAndExit ("Can not paste unknown file type.");
@ -8608,10 +8622,10 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
/***** Check if exists the destination file */ /***** Check if exists the destination file */
if (Fil_CheckIfPathExists (PathDstWithFile)) if (Fil_CheckIfPathExists (PathDstWithFile))
{ {
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_there_is_already_an_object_with_that_name : FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_there_is_already_an_object_with_that_name :
Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_there_is_already_an_object_with_that_name, Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_there_is_already_an_object_with_that_name,
FileNameToShow); FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false; CopyIsGoingSuccessful = false;
} }
@ -8627,8 +8641,9 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Mrk_CheckFileOfMarks (PathOrg,&Marks); // Gbl.Alert.Txt contains feedback text Mrk_CheckFileOfMarks (PathOrg,&Marks); // Gbl.Alert.Txt contains feedback text
else else
{ {
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_you_can_not_paste_a_file_here_of_a_type_other_than_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_you_can_not_paste_a_file_here_of_a_type_other_than_HTML,
FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false; CopyIsGoingSuccessful = false;
} }
@ -8641,9 +8656,10 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size; Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size;
if (Brw_CheckIfQuotaExceded ()) if (Brw_CheckIfQuotaExceded ())
{ {
sprintf (Gbl.Alert.Txt,FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_disk_quota : snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_disk_quota, FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_disk_quota :
FileNameToShow); Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_disk_quota,
FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false; CopyIsGoingSuccessful = false;
} }
@ -8684,8 +8700,9 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size; Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size;
if (Brw_CheckIfQuotaExceded ()) if (Brw_CheckIfQuotaExceded ())
{ {
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_disk_quota, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_disk_quota,
FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false; CopyIsGoingSuccessful = false;
} }
@ -8811,8 +8828,9 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1])
/***** Start box *****/ /***** Start box *****/
Box_StartBox (NULL,Txt_Create_folder,NULL, Box_StartBox (NULL,Txt_Create_folder,NULL,
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
sprintf (Gbl.Alert.Txt,Txt_You_can_create_a_new_folder_inside_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_You_can_create_a_new_folder_inside_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Folder *****/ /***** Folder *****/
@ -8850,8 +8868,9 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Help message *****/ /***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_upload_new_files_to_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_or_you_can_upload_new_files_to_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Form to upload files using the library Dropzone.js *****/ /***** Form to upload files using the library Dropzone.js *****/
@ -8912,8 +8931,9 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Help message *****/ /***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_upload_a_new_file_to_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_or_you_can_upload_a_new_file_to_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Form to upload one files using the classic way *****/ /***** Form to upload one files using the classic way *****/
@ -8955,8 +8975,9 @@ static void Brw_PutFormToPasteAFileOrFolder (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Help message *****/ /***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_make_a_file_copy_to_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_or_you_can_make_a_file_copy_to_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Send button and end box *****/ /***** Send button and end box *****/
@ -8991,8 +9012,9 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Help message *****/ /***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_create_a_new_link_inside_the_folder_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_or_you_can_create_a_new_link_inside_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** URL *****/ /***** URL *****/
@ -9080,8 +9102,9 @@ void Brw_RecFolderFileBrowser (void)
if (Brw_CheckIfQuotaExceded ()) if (Brw_CheckIfQuotaExceded ())
{ {
Fil_RemoveTree (Path); Fil_RemoveTree (Path);
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_folder_X_because_it_would_exceed_the_disk_quota, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_Can_not_create_the_folder_X_because_it_would_exceed_the_disk_quota,
Gbl.FileBrowser.NewFilFolLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -9107,8 +9130,9 @@ void Brw_RecFolderFileBrowser (void)
Brw_IS_FOLDER, Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName, Gbl.FileBrowser.FilFolLnkName,
FileNameToShow); FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_The_folder_X_has_been_created_inside_the_folder_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName,FileNameToShow); Txt_The_folder_X_has_been_created_inside_the_folder_Y,
Gbl.FileBrowser.NewFilFolLnkName,FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
@ -9117,8 +9141,9 @@ void Brw_RecFolderFileBrowser (void)
switch (errno) switch (errno)
{ {
case EEXIST: case EEXIST:
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_folder_X_because_there_is_already_a_folder_or_a_file_with_that_name, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_Can_not_create_the_folder_X_because_there_is_already_a_folder_or_a_file_with_that_name,
Gbl.FileBrowser.NewFilFolLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
break; break;
case EACCES: case EACCES:
@ -9195,8 +9220,9 @@ void Brw_RenFolderFileBrowser (void)
case ENOTEMPTY: case ENOTEMPTY:
case EEXIST: case EEXIST:
case ENOTDIR: case ENOTDIR:
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_not_changed_because_there_is_already_a_folder_or_a_file_with_the_name_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName,Gbl.FileBrowser.NewFilFolLnkName); Txt_The_folder_name_X_has_not_changed_because_there_is_already_a_folder_or_a_file_with_the_name_Y,
Gbl.FileBrowser.FilFolLnkName,Gbl.FileBrowser.NewFilFolLnkName);
break; break;
case EACCES: case EACCES:
Lay_ShowErrorAndExit ("Write forbidden."); Lay_ShowErrorAndExit ("Write forbidden.");
@ -9230,17 +9256,19 @@ void Brw_RenFolderFileBrowser (void)
NewPathInTree); NewPathInTree);
/* Write message of confirmation */ /* Write message of confirmation */
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName, Txt_The_folder_name_X_has_changed_to_Y,
Gbl.FileBrowser.NewFilFolLnkName); Gbl.FileBrowser.FilFolLnkName,
Gbl.FileBrowser.NewFilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // Names are equal. This may happens if we have press INTRO without changing the name else // Names are equal. This may happens if we have press INTRO without changing the name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName); Txt_The_folder_name_X_has_not_changed,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -9366,8 +9394,9 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
if (Fil_CheckIfPathExists (Path)) if (Fil_CheckIfPathExists (Path))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_file_already_exists_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_UPLOAD_FILE_X_file_already_exists_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
} }
else // Destination file does not exist else // Destination file does not exist
{ {
@ -9388,8 +9417,9 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
{ {
Fil_RemoveTree (PathTmp); Fil_RemoveTree (PathTmp);
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_could_not_create_file_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_UPLOAD_FILE_could_not_create_file_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
} }
else // Success else // Success
{ {
@ -9400,8 +9430,9 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
{ {
Fil_RemoveTree (Path); Fil_RemoveTree (Path);
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_quota_exceeded_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_UPLOAD_FILE_X_quota_exceeded_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
} }
else else
{ {
@ -9429,9 +9460,10 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
Gbl.FileBrowser.FilFolLnkName, Gbl.FileBrowser.FilFolLnkName,
FileNameToShow); FileNameToShow);
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_file_X_has_been_placed_inside_the_folder_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName, Txt_The_file_X_has_been_placed_inside_the_folder_Y,
FileNameToShow); Gbl.FileBrowser.NewFilFolLnkName,
FileNameToShow);
} }
UploadSucessful = true; UploadSucessful = true;
@ -9572,8 +9604,9 @@ void Brw_RecLinkFileBrowser (void)
/* Check if the URL file exists */ /* Check if the URL file exists */
if (Fil_CheckIfPathExists (Path)) if (Fil_CheckIfPathExists (Path))
{ {
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_link_X_because_there_is_already_a_folder_or_a_link_with_that_name, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileName); Txt_Can_not_create_the_link_X_because_there_is_already_a_folder_or_a_link_with_that_name,
FileName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // URL file does not exist else // URL file does not exist
@ -9593,8 +9626,9 @@ void Brw_RecLinkFileBrowser (void)
if (Brw_CheckIfQuotaExceded ()) if (Brw_CheckIfQuotaExceded ())
{ {
Fil_RemoveTree (Path); Fil_RemoveTree (Path);
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_link_X_because_it_would_exceed_the_disk_quota, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileName); Txt_Can_not_create_the_link_X_because_it_would_exceed_the_disk_quota,
FileName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -9620,8 +9654,9 @@ void Brw_RecLinkFileBrowser (void)
Brw_IS_FOLDER, Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName, Gbl.FileBrowser.FilFolLnkName,
FileNameToShow); FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_The_link_X_has_been_placed_inside_the_folder_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileName,FileNameToShow); Txt_The_link_X_has_been_placed_inside_the_folder_Y,
FileName,FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
FileMetadata.FilCod = FilCod; FileMetadata.FilCod = FilCod;
@ -9695,15 +9730,17 @@ static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
if (strcmp (MIMEType,"application/octetstream")) if (strcmp (MIMEType,"application/octetstream"))
if (strcmp (MIMEType,"application/octet")) if (strcmp (MIMEType,"application/octet"))
{ // MIME type forbidden { // MIME type forbidden
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType); Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType);
return false; return false;
} }
} }
else else
{ {
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_not_HTML_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_UPLOAD_FILE_X_not_HTML_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
return false; return false;
} }
break; break;
@ -9730,15 +9767,17 @@ static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
} }
if (!MIMETypeIsAllowed) if (!MIMETypeIsAllowed)
{ {
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType); Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType);
return false; return false;
} }
} }
else else
{ {
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_extension_not_allowed_NO_HTML, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.NewFilFolLnkName); Txt_UPLOAD_FILE_X_extension_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
return false; return false;
} }
break; break;
@ -9775,8 +9814,9 @@ void Brw_SetDocumentAsVisible (void)
Gbl.FileBrowser.FileType, Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName, Gbl.FileBrowser.FilFolLnkName,
FileNameToShow); FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_FILE_FOLDER_OR_LINK_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileNameToShow); Txt_FILE_FOLDER_OR_LINK_X_is_now_visible,
FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show again the file browser *****/ /***** Show again the file browser *****/
@ -9812,7 +9852,9 @@ void Brw_SetDocumentAsHidden (void)
Gbl.FileBrowser.FileType, Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName, Gbl.FileBrowser.FilFolLnkName,
FileNameToShow); FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_FILE_FOLDER_OR_LINK_X_is_now_hidden,FileNameToShow); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_FILE_FOLDER_OR_LINK_X_is_now_hidden,
FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show again the file browser *****/ /***** Show again the file browser *****/
@ -10777,15 +10819,17 @@ void Brw_ChgFileMetadata (void)
} }
/***** Write message of confirmation *****/ /***** Write message of confirmation *****/
sprintf (Gbl.Alert.Txt,Txt_The_properties_of_file_X_have_been_saved, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName); Txt_The_properties_of_file_X_have_been_saved,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
{ {
/***** Write message of error *****/ /***** Write message of error *****/
sprintf (Gbl.Alert.Txt,Txt_You_dont_have_permission_to_change_the_properties_of_file_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.FileBrowser.FilFolLnkName); Txt_You_dont_have_permission_to_change_the_properties_of_file_X,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
@ -12793,12 +12837,13 @@ void Brw_RemoveOldFilesBriefcase (void)
Brw_RemoveOldFilesInBrowser (Months,&Removed); Brw_RemoveOldFilesInBrowser (Months,&Removed);
/***** Success message *****/ /***** Success message *****/
sprintf (Gbl.Alert.Txt,"%s: %u<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %u<br />" "%s: %u<br />"
"%s: %u", "%s: %u<br />"
Txt_Files_removed ,Removed.NumFiles, "%s: %u",
Txt_Links_removed ,Removed.NumLinks, Txt_Files_removed ,Removed.NumFiles,
Txt_Folders_removed,Removed.NumFolds); Txt_Links_removed ,Removed.NumLinks,
Txt_Folders_removed,Removed.NumFolds);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -4162,8 +4162,9 @@ void For_RequestRemoveThread (void)
/***** Show question and button to remove the thread *****/ /***** Show question and button to remove the thread *****/
Lay_StartSection (For_REMOVE_THREAD_SECTION_ID); Lay_StartSection (For_REMOVE_THREAD_SECTION_ID);
if (Subject[0]) if (Subject[0])
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_entire_thread_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Subject); Txt_Do_you_really_want_to_remove_the_entire_thread_X,
Subject);
else else
Str_Copy (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_entire_thread, Str_Copy (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_entire_thread,
Ale_MAX_BYTES_ALERT); Ale_MAX_BYTES_ALERT);
@ -4218,7 +4219,8 @@ void For_RemoveThread (void)
/***** Show the threads again *****/ /***** Show the threads again *****/
if (Subject[0]) if (Subject[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_Thread_X_removed,Subject); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Thread_X_removed,Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod, For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_SUCCESS,Gbl.Alert.Txt); Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -4255,7 +4257,8 @@ void For_CutThread (void)
/***** Show the threads again *****/ /***** Show the threads again *****/
if (Subject[0]) if (Subject[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_Thread_X_marked_to_be_moved,Subject); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Thread_X_marked_to_be_moved,Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod, For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_SUCCESS,Gbl.Alert.Txt); Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -4292,8 +4295,9 @@ void For_PasteThread (void)
/***** Show the threads again *****/ /***** Show the threads again *****/
if (Subject[0]) if (Subject[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_The_thread_X_is_already_in_this_forum, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Subject); Txt_The_thread_X_is_already_in_this_forum,
Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod, For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_WARNING,Gbl.Alert.Txt); Ale_WARNING,Gbl.Alert.Txt);
} }
@ -4312,8 +4316,9 @@ void For_PasteThread (void)
/***** Show the threads again *****/ /***** Show the threads again *****/
if (Subject[0]) if (Subject[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_Thread_X_moved_to_this_forum, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Subject); Txt_Thread_X_moved_to_this_forum,
Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod, For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_SUCCESS,Gbl.Alert.Txt); Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -1495,8 +1495,9 @@ void Gam_AskRemGame (void)
/***** Show question and button to remove game *****/ /***** Show question and button to remove game *****/
Gbl.Games.CurrentGamCod = Game.GamCod; Gbl.Games.CurrentGamCod = Game.GamCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_game_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game.Title); Txt_Do_you_really_want_to_remove_the_game_X,
Game.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGam,NULL,NULL,Gam_PutParams, ActRemGam,NULL,NULL,Gam_PutParams,
Btn_REMOVE_BUTTON,Txt_Remove_game); Btn_REMOVE_BUTTON,Txt_Remove_game);
@ -1544,8 +1545,9 @@ void Gam_RemoveGame (void)
DB_QueryDELETE (Query,"can not remove game"); DB_QueryDELETE (Query,"can not remove game");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game.Title); Txt_Game_X_removed,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show games again *****/ /***** Show games again *****/
@ -1576,8 +1578,9 @@ void Gam_AskResetGame (void)
Lay_ShowErrorAndExit ("You can not reset this game."); Lay_ShowErrorAndExit ("You can not reset this game.");
/***** Ask for confirmation of reset *****/ /***** Ask for confirmation of reset *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reset_the_game_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game.Title); Txt_Do_you_really_want_to_reset_the_game_X,
Game.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
/***** Button of confirmation of reset *****/ /***** Button of confirmation of reset *****/
@ -1634,8 +1637,9 @@ void Gam_ResetGame (void)
DB_QueryUPDATE (Query,"can not reset answers of a game"); DB_QueryUPDATE (Query,"can not reset answers of a game");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_reset, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game.Title); Txt_Game_X_reset,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show games again *****/ /***** Show games again *****/
@ -1667,8 +1671,9 @@ void Gam_HideGame (void)
DB_QueryUPDATE (Query,"can not hide game"); DB_QueryUPDATE (Query,"can not hide game");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_is_now_hidden, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game.Title); Txt_Game_X_is_now_hidden,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show games again *****/ /***** Show games again *****/
@ -1700,8 +1705,9 @@ void Gam_UnhideGame (void)
DB_QueryUPDATE (Query,"can not show game"); DB_QueryUPDATE (Query,"can not show game");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game.Title); Txt_Game_X_is_now_visible,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show games again *****/ /***** Show games again *****/
@ -2143,8 +2149,9 @@ void Gam_RecFormGame (void)
if (Gam_CheckIfSimilarGameExists (&NewGame)) if (Gam_CheckIfSimilarGameExists (&NewGame))
{ {
NewGameIsCorrect = false; NewGameIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_a_game_with_the_title_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewGame.Title); Txt_Already_existed_a_game_with_the_title_X,
NewGame.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
@ -2208,8 +2215,9 @@ static void Gam_CreateGame (struct Game *Game,const char *Txt)
Gam_CreateGrps (Game->GamCod); Gam_CreateGrps (Game->GamCod);
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_game_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Game->Title); Txt_Created_new_game_X,
Game->Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -3272,8 +3280,9 @@ void Gam_RequestRemoveQst (void)
/***** Show question and button to remove question *****/ /***** Show question and button to remove question *****/
Gbl.Games.CurrentGamCod = Game.GamCod; Gbl.Games.CurrentGamCod = Game.GamCod;
Gbl.Games.CurrentQstCod = QstCod; Gbl.Games.CurrentQstCod = QstCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned long) (QstInd + 1)); Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) (QstInd + 1));
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGamQst,NULL,NULL,Gam_PutParamsOneQst, ActRemGamQst,NULL,NULL,Gam_PutParamsOneQst,
Btn_REMOVE_BUTTON,Txt_Remove_question); Btn_REMOVE_BUTTON,Txt_Remove_question);

View File

@ -281,8 +281,9 @@ static void Grp_EditGroupTypes (void)
Grp_ListGroupTypesForEdition (); Grp_ListGroupTypesForEdition ();
else // No group types found in this course else // No group types found in this course
{ {
sprintf (Gbl.Alert.Txt,Txt_There_are_no_types_of_group_in_the_course_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.ShrtName); Txt_There_are_no_types_of_group_in_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
@ -312,8 +313,9 @@ static void Grp_EditGroups (void)
Grp_ListGroupsForEdition (); Grp_ListGroupsForEdition ();
else // There are group types, but there aren't groups else // There are group types, but there aren't groups
{ {
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.ShrtName); Txt_No_groups_have_been_created_in_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
@ -1103,17 +1105,19 @@ void Grp_RegisterUsrIntoGroups (struct UsrData *UsrDat,struct ListCodGrps *LstGr
/* If the enrolment is single and the group to which the user belongs is different from the selected ==> /* If the enrolment is single and the group to which the user belongs is different from the selected ==>
remove user from the group to which he belongs */ remove user from the group to which he belongs */
Grp_RemoveUsrFromGroup (UsrDat->UsrCod,LstGrpsHeBelongs.GrpCods[NumGrpHeBelongs]); Grp_RemoveUsrFromGroup (UsrDat->UsrCod,LstGrpsHeBelongs.GrpCods[NumGrpHeBelongs]);
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_the_group_of_type_Y_to_which_it_belonged, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName); Txt_THE_USER_X_has_been_removed_from_the_group_of_type_Y_to_which_it_belonged,
UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
if (!AlreadyRegisteredInGrp) // If the user does not belong to the selected group if (!AlreadyRegisteredInGrp) // If the user does not belong to the selected group
{ {
Grp_AddUsrToGroup (UsrDat,LstGrps->GrpCods[NumGrpSel]); Grp_AddUsrToGroup (UsrDat,LstGrps->GrpCods[NumGrpSel]);
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_group_of_type_Y_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName, Txt_THE_USER_X_has_been_enroled_in_the_group_of_type_Y_Z,
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrpThisType].GrpName); UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName,
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrpThisType].GrpName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1162,14 +1166,17 @@ unsigned Grp_RemoveUsrFromGroups (struct UsrData *UsrDat,struct ListCodGrps *Lst
/***** Write message to inform about how many groups the student has been removed from *****/ /***** Write message to inform about how many groups the student has been removed from *****/
if (NumGrpsHeIsRemoved == 0) if (NumGrpsHeIsRemoved == 0)
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_not_been_removed_from_any_group, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_THE_USER_X_has_not_been_removed_from_any_group,
UsrDat->FullName);
else if (NumGrpsHeIsRemoved == 1) else if (NumGrpsHeIsRemoved == 1)
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_one_group, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_THE_USER_X_has_been_removed_from_one_group,
UsrDat->FullName);
else // NumGrpsHeIsRemoved > 1 else // NumGrpsHeIsRemoved > 1
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_Y_groups, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName,NumGrpsHeIsRemoved); Txt_THE_USER_X_has_been_removed_from_Y_groups,
UsrDat->FullName,NumGrpsHeIsRemoved);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Free the list of groups of this type to which the user belonged *****/ /***** Free the list of groups of this type to which the user belonged *****/
@ -1800,8 +1807,9 @@ void Grp_ShowLstGrpsToChgMyGrps (void)
} }
else // This course has no groups else // This course has no groups
{ {
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName); Txt_No_groups_have_been_created_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Button to create group *****/ /***** Button to create group *****/
@ -1854,18 +1862,18 @@ static void Grp_ShowWarningToStdsToChangeGrps (void)
{ {
if (GrpTyp->MandatoryEnrolment) if (GrpTyp->MandatoryEnrolment)
{ {
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpTyp->MultipleEnrolment ? Txt_You_have_to_register_compulsorily_at_least_in_one_group_of_type_X : GrpTyp->MultipleEnrolment ? Txt_You_have_to_register_compulsorily_at_least_in_one_group_of_type_X :
Txt_You_have_to_register_compulsorily_in_one_group_of_type_X, Txt_You_have_to_register_compulsorily_in_one_group_of_type_X,
GrpTyp->GrpTypName); GrpTyp->GrpTypName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
{ {
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpTyp->MultipleEnrolment ? Txt_You_can_register_voluntarily_in_one_or_more_groups_of_type_X : GrpTyp->MultipleEnrolment ? Txt_You_can_register_voluntarily_in_one_or_more_groups_of_type_X :
Txt_You_can_register_voluntarily_in_one_group_of_type_X, Txt_You_can_register_voluntarily_in_one_group_of_type_X,
GrpTyp->GrpTypName); GrpTyp->GrpTypName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -3678,16 +3686,18 @@ void Grp_RecFormNewGrpTyp (void)
if (Grp_CheckIfGroupTypeNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,-1L)) if (Grp_CheckIfGroupTypeNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,-1L))
{ {
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_The_type_of_group_X_already_exists,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
else // Add new group type to database else // Add new group type to database
{ {
Grp_CreateGroupType (); Grp_CreateGroupType ();
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_type_of_group_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_Created_new_type_of_group_X,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
} }
else // If there is not a group type name else // If there is not a group type name
@ -3747,8 +3757,9 @@ void Grp_RecFormNewGrp (void)
if (Grp_CheckIfGroupNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod,Gbl.CurrentCrs.Grps.GrpName,-1L)) if (Grp_CheckIfGroupNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod,Gbl.CurrentCrs.Grps.GrpName,-1L))
{ {
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpName); Txt_The_group_X_already_exists,
Gbl.CurrentCrs.Grps.GrpName);
} }
else // Add new group to database else // Add new group to database
{ {
@ -3756,8 +3767,9 @@ void Grp_RecFormNewGrp (void)
/* Write success message */ /* Write success message */
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_group_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpName); Txt_Created_new_group_X,
Gbl.CurrentCrs.Grps.GrpName);
} }
} }
else // If there is not a group name else // If there is not a group name
@ -3904,11 +3916,13 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps)
/***** Show question and button to remove type of group *****/ /***** Show question and button to remove type of group *****/
if (NumGrps == 1) if (NumGrps == 1)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
else else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NumGrps); Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NumGrps);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL, ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL,
Grp_PutParamRemGrpTyp, Grp_PutParamRemGrpTyp,
@ -3954,14 +3968,17 @@ static void Grp_AskConfirmRemGrp (void)
/***** Show question and button to remove group *****/ /***** Show question and button to remove group *****/
if (NumStds == 0) if (NumStds == 0)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_Do_you_really_want_to_remove_the_group_X,
GrpDat.GrpName);
else if (NumStds == 1) else if (NumStds == 1)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X_1_student_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_Do_you_really_want_to_remove_the_group_X_1_student_,
GrpDat.GrpName);
else else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName,NumStds); Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
GrpDat.GrpName,NumStds);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGrp,Grp_GROUPS_SECTION_ID,NULL, ActRemGrp,Grp_GROUPS_SECTION_ID,NULL,
Grp_PutParamRemGrp, Grp_PutParamRemGrp,
@ -4055,9 +4072,10 @@ static void Grp_RemoveGroupTypeCompletely (void)
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod); Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod);
DB_QueryDELETE (Query,"can not remove a type of group"); DB_QueryDELETE (Query,"can not remove a type of group");
/***** Write message to show the change made *****/ /***** Create message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Type_of_group_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_Type_of_group_X_removed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
/***** Show the form again *****/ /***** Show the form again *****/
Grp_ReqEditGroupsInternal (Ale_SUCCESS,Gbl.Alert.Txt, Grp_ReqEditGroupsInternal (Ale_SUCCESS,Gbl.Alert.Txt,
@ -4105,8 +4123,10 @@ static void Grp_RemoveGroupCompletely (void)
Gbl.CurrentCrs.Grps.GrpCod); Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryDELETE (Query,"can not remove a group"); DB_QueryDELETE (Query,"can not remove a group");
/***** Write message to show the change made *****/ /***** Create message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Group_X_removed,GrpDat.GrpName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Group_X_removed,
GrpDat.GrpName);
/***** Show the form again *****/ /***** Show the form again *****/
Grp_ReqEditGroupsInternal (Ale_INFO,NULL, Grp_ReqEditGroupsInternal (Ale_INFO,NULL,
@ -4136,8 +4156,10 @@ void Grp_OpenGroup (void)
Gbl.CurrentCrs.Grps.GrpCod); Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not open a group"); DB_QueryUPDATE (Query,"can not open a group");
/***** Write message to show the change made *****/ /***** Create message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_group_X_is_now_open,GrpDat.GrpName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_is_now_open,
GrpDat.GrpName);
/***** Show the form again *****/ /***** Show the form again *****/
Gbl.CurrentCrs.Grps.Open = true; Gbl.CurrentCrs.Grps.Open = true;
@ -4168,8 +4190,10 @@ void Grp_CloseGroup (void)
Gbl.CurrentCrs.Grps.GrpCod); Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not close a group"); DB_QueryUPDATE (Query,"can not close a group");
/***** Write message to show the change made *****/ /***** Create message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_group_X_is_now_closed,GrpDat.GrpName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_is_now_closed,
GrpDat.GrpName);
/***** Show the form again *****/ /***** Show the form again *****/
Gbl.CurrentCrs.Grps.Open = false; Gbl.CurrentCrs.Grps.Open = false;
@ -4200,9 +4224,10 @@ void Grp_EnableFileZonesGrp (void)
Gbl.CurrentCrs.Grps.GrpCod); Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not enable file zones of a group"); DB_QueryUPDATE (Query,"can not enable file zones of a group");
/***** Write message to show the change made *****/ /***** Create message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_File_zones_of_the_group_X_are_now_enabled, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_File_zones_of_the_group_X_are_now_enabled,
GrpDat.GrpName);
/***** Show the form again *****/ /***** Show the form again *****/
Gbl.CurrentCrs.Grps.FileZones = true; Gbl.CurrentCrs.Grps.FileZones = true;
@ -4233,9 +4258,10 @@ void Grp_DisableFileZonesGrp (void)
Gbl.CurrentCrs.Grps.GrpCod); Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not disable file zones of a group"); DB_QueryUPDATE (Query,"can not disable file zones of a group");
/***** Write message to show the change made *****/ /***** Create message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_File_zones_of_the_group_X_are_now_disabled, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_File_zones_of_the_group_X_are_now_disabled,
GrpDat.GrpName);
/***** Show the form again *****/ /***** Show the form again *****/
Gbl.CurrentCrs.Grps.FileZones = false; Gbl.CurrentCrs.Grps.FileZones = false;
@ -4271,20 +4297,24 @@ void Grp_ChangeGroupType (void)
/***** If group was in database... *****/ /***** If group was in database... *****/
if (Grp_CheckIfGroupNameExists (NewGrpTypCod,GrpDat.GrpName,-1L)) if (Grp_CheckIfGroupNameExists (NewGrpTypCod,GrpDat.GrpName,-1L))
{ {
/* Create warning message */
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,GrpDat.GrpName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_already_exists,
GrpDat.GrpName);
} }
else else // Group is not in database
{ {
/* Update the table of groups changing old type by new type */ /* Update the table of groups changing old type by new type */
sprintf (Query,"UPDATE crs_grp SET GrpTypCod=%ld WHERE GrpCod=%ld", sprintf (Query,"UPDATE crs_grp SET GrpTypCod=%ld WHERE GrpCod=%ld",
NewGrpTypCod,Gbl.CurrentCrs.Grps.GrpCod); NewGrpTypCod,Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not update the type of a group"); DB_QueryUPDATE (Query,"can not update the type of a group");
/***** Write message to show the change made *****/ /* Create message to show the change made */
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_of_the_group_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_The_type_of_group_of_the_group_X_has_changed,
GrpDat.GrpName);
} }
/***** Show the form again *****/ /***** Show the form again *****/
@ -4322,8 +4352,9 @@ void Grp_ChangeMandatGrpTyp (void)
if (Gbl.CurrentCrs.Grps.GrpTyp.MandatoryEnrolment == NewMandatoryEnrolment) if (Gbl.CurrentCrs.Grps.GrpTyp.MandatoryEnrolment == NewMandatoryEnrolment)
{ {
AlertType = Ale_INFO; AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
else else
{ {
@ -4336,10 +4367,10 @@ void Grp_ChangeMandatGrpTyp (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewMandatoryEnrolment ? Txt_The_enrolment_of_students_into_groups_of_type_X_is_now_mandatory : NewMandatoryEnrolment ? Txt_The_enrolment_of_students_into_groups_of_type_X_is_now_mandatory :
Txt_The_enrolment_of_students_into_groups_of_type_X_is_now_voluntary, Txt_The_enrolment_of_students_into_groups_of_type_X_is_now_voluntary,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
/***** Show the form again *****/ /***** Show the form again *****/
@ -4377,8 +4408,9 @@ void Grp_ChangeMultiGrpTyp (void)
if (Gbl.CurrentCrs.Grps.GrpTyp.MultipleEnrolment == NewMultipleEnrolment) if (Gbl.CurrentCrs.Grps.GrpTyp.MultipleEnrolment == NewMultipleEnrolment)
{ {
AlertType = Ale_INFO; AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
else else
{ {
@ -4392,10 +4424,10 @@ void Grp_ChangeMultiGrpTyp (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewMultipleEnrolment ? Txt_Now_each_student_can_belong_to_multiple_groups_of_type_X : NewMultipleEnrolment ? Txt_Now_each_student_can_belong_to_multiple_groups_of_type_X :
Txt_Now_each_student_can_only_belong_to_a_group_of_type_X, Txt_Now_each_student_can_only_belong_to_a_group_of_type_X,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
/***** Show the form again *****/ /***** Show the form again *****/
@ -4477,8 +4509,9 @@ void Grp_ChangeMaxStdsGrp (void)
if (GrpDat.MaxStudents == NewMaxStds) if (GrpDat.MaxStudents == NewMaxStds)
{ {
AlertType = Ale_INFO; AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed,
GrpDat.GrpName);
} }
else else
{ {
@ -4490,11 +4523,13 @@ void Grp_ChangeMaxStdsGrp (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
if (NewMaxStds > Grp_MAX_STUDENTS_IN_A_GROUP) if (NewMaxStds > Grp_MAX_STUDENTS_IN_A_GROUP)
sprintf (Gbl.Alert.Txt,Txt_The_group_X_now_has_no_limit_of_students, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_The_group_X_now_has_no_limit_of_students,
GrpDat.GrpName);
else else
sprintf (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName,NewMaxStds); Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y,
GrpDat.GrpName,NewMaxStds);
} }
/***** Show the form again *****/ /***** Show the form again *****/
@ -4557,8 +4592,9 @@ void Grp_RenameGroupType (void)
if (!NewNameGrpTyp[0]) if (!NewNameGrpTyp[0])
{ {
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_type_of_group_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName); Txt_You_can_not_leave_the_name_of_the_type_of_group_X_empty,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
} }
else else
{ {
@ -4569,8 +4605,9 @@ void Grp_RenameGroupType (void)
if (Grp_CheckIfGroupTypeNameExists (NewNameGrpTyp,Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod)) if (Grp_CheckIfGroupTypeNameExists (NewNameGrpTyp,Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod))
{ {
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNameGrpTyp); Txt_The_type_of_group_X_already_exists,
NewNameGrpTyp);
} }
else else
{ {
@ -4583,15 +4620,17 @@ void Grp_RenameGroupType (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NewNameGrpTyp); Txt_The_type_of_group_X_has_been_renamed_as_Y,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NewNameGrpTyp);
} }
} }
else // The same name else // The same name
{ {
AlertType = Ale_INFO; AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_type_of_group_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNameGrpTyp); Txt_The_name_of_the_type_of_group_X_has_not_changed,
NewNameGrpTyp);
} }
} }
@ -4633,8 +4672,9 @@ void Grp_RenameGroup (void)
if (!NewNameGrp[0]) if (!NewNameGrp[0])
{ {
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_group_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName); Txt_You_can_not_leave_the_name_of_the_group_X_empty,
GrpDat.GrpName);
} }
else else
{ {
@ -4645,7 +4685,9 @@ void Grp_RenameGroup (void)
if (Grp_CheckIfGroupNameExists (GrpDat.GrpTypCod,NewNameGrp,Gbl.CurrentCrs.Grps.GrpCod)) if (Grp_CheckIfGroupNameExists (GrpDat.GrpTypCod,NewNameGrp,Gbl.CurrentCrs.Grps.GrpCod))
{ {
AlertType = Ale_WARNING; AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,NewNameGrp); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_already_exists,
NewNameGrp);
} }
else else
{ {
@ -4656,15 +4698,17 @@ void Grp_RenameGroup (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
AlertType = Ale_SUCCESS; AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpDat.GrpName,NewNameGrp); Txt_The_group_X_has_been_renamed_as_Y,
GrpDat.GrpName,NewNameGrp);
} }
} }
else // The same name else // The same name
{ {
AlertType = Ale_INFO; AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_group_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNameGrp); Txt_The_name_of_the_group_X_has_not_changed,
NewNameGrp);
} }
} }

View File

@ -121,10 +121,11 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
if (Gbl.Usrs.Me.Logged && if (Gbl.Usrs.Me.Logged &&
!Gbl.Usrs.Me.MyCrss.Num) !Gbl.Usrs.Me.MyCrss.Num)
{ {
sprintf (Gbl.Alert.Txt,"%s<br />%s<br />%s", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_are_not_enroled_in_any_course[Gbl.Usrs.Me.UsrDat.Sex], "%s<br />%s<br />%s",
Txt_You_can_search_for_courses_select_them_and_request_your_enrolment_in_them, Txt_You_are_not_enroled_in_any_course[Gbl.Usrs.Me.UsrDat.Sex],
Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them); Txt_You_can_search_for_courses_select_them_and_request_your_enrolment_in_them,
Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }

View File

@ -656,7 +656,9 @@ void Hld_RemoveHoliday1 (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Holiday_X_removed,Hld.Name); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Holiday_X_removed,
Hld.Name);
} }
@ -706,8 +708,9 @@ void Hld_ChangeHolidayPlace1 (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_place_of_the_holiday_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hld->Name,NewPlace.FullName); Txt_The_place_of_the_holiday_X_has_changed_to_Y,
Hld->Name,NewPlace.FullName);
} }
void Hld_ChangeHolidayPlace2 (void) void Hld_ChangeHolidayPlace2 (void)
@ -750,8 +753,9 @@ void Hld_ChangeHolidayType1 (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_the_holiday_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hld->Name); Txt_The_type_of_the_holiday_X_has_changed,
Hld->Name);
} }
void Hld_ChangeHolidayType2 (void) void Hld_ChangeHolidayType2 (void)
@ -850,8 +854,9 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Dat_ConvDateToDateStr (&NewDate,StrDate); Dat_ConvDateToDateStr (&NewDate,StrDate);
sprintf (Gbl.Alert.Txt,Txt_The_date_of_the_holiday_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hld->Name,StrDate); Txt_The_date_of_the_holiday_X_has_changed_to_Y,
Hld->Name,StrDate);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -897,8 +902,9 @@ void Hld_RenameHoliday1 (void)
if (!NewHldName[0]) if (!NewHldName[0])
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_holiday_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hld->Name); Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
Hld->Name);
} }
else else
{ {
@ -915,14 +921,16 @@ void Hld_RenameHoliday1 (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_holiday_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hld->Name,NewHldName); Txt_The_name_of_the_holiday_X_has_changed_to_Y,
Hld->Name,NewHldName);
} }
else // The same name else // The same name
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_holiday_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hld->Name); Txt_The_name_of_the_holiday_X_has_not_changed,
Hld->Name);
} }
} }
} }
@ -1152,7 +1160,9 @@ void Hld_RecFormNewHoliday1 (void)
/* Success message */ /* Success message */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_holiday_X,Hld->Name); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_holiday_X,
Hld->Name);
} }
else // If there is not a holiday name else // If there is not a holiday name
{ {

View File

@ -489,9 +489,10 @@ static void Img_ProcessImage (struct Image *Image,
ReturnCode = WEXITSTATUS(ReturnCode); ReturnCode = WEXITSTATUS(ReturnCode);
if (ReturnCode != 0) if (ReturnCode != 0)
{ {
sprintf (Gbl.Alert.Txt,"Image could not be processed successfully.<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Error code returned by the program of processing: %d", "Image could not be processed successfully.<br />"
ReturnCode); "Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
} }

View File

@ -529,8 +529,9 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss)
extern const char *Txt_Show_anyway; extern const char *Txt_Show_anyway;
/***** Show alert and button to confirm that I want to see the big list *****/ /***** Show alert and button to confirm that I want to see the big list *****/
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_courses_is_too_large_to_be_displayed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumCrss); Txt_The_list_of_X_courses_is_too_large_to_be_displayed,
NumCrss);
Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt,
Gbl.Action.Act,NULL,NULL, Gbl.Action.Act,NULL,NULL,
Ind_PutParamsConfirmIWantToSeeBigList, Ind_PutParamsConfirmIWantToSeeBigList,

View File

@ -2234,8 +2234,9 @@ void Inf_ReceiveURLInfo (void)
fclose (FileURL); fclose (FileURL);
/***** Write message *****/ /***** Write message *****/
sprintf (Gbl.Alert.Txt,Txt_The_URL_X_has_been_updated, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Info.URL); Txt_The_URL_X_has_been_updated,
Gbl.CurrentCrs.Info.URL);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
URLIsOK = true; URLIsOK = true;
} }
@ -2303,8 +2304,9 @@ void Inf_ReceivePagInfo (void)
WrongType = true; WrongType = true;
if (WrongType) if (WrongType)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_file_type_is_X_and_should_be_HTML_or_ZIP, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
MIMEType); Txt_The_file_type_is_X_and_should_be_HTML_or_ZIP,
MIMEType);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else else

View File

@ -1727,8 +1727,9 @@ void Ins_RemoveInstitution (void)
Ins_FlushCacheFullNameAndCtyOfInstitution (); Ins_FlushCacheFullNameAndCtyOfInstitution ();
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Institution_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Ins.FullName); Txt_Institution_X_removed,
Ins.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1808,8 +1809,9 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
if (!NewInsName[0]) if (!NewInsName[0])
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_institution_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentInsName); Txt_You_can_not_leave_the_name_of_the_institution_X_empty,
CurrentInsName);
} }
else else
{ {
@ -1820,8 +1822,9 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
if (Ins_CheckIfInsNameExistsInCty (ParamName,NewInsName,Ins->InsCod,Gbl.CurrentCty.Cty.CtyCod)) if (Ins_CheckIfInsNameExistsInCty (ParamName,NewInsName,Ins->InsCod,Gbl.CurrentCty.Cty.CtyCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewInsName); Txt_The_institution_X_already_exists,
NewInsName);
} }
else else
{ {
@ -1830,8 +1833,9 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
/* Create message to show the change made */ /* Create message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentInsName,NewInsName); Txt_The_institution_X_has_been_renamed_as_Y,
CurrentInsName,NewInsName);
/* Change current institution name in order to display it properly */ /* Change current institution name in order to display it properly */
Str_Copy (CurrentInsName,NewInsName, Str_Copy (CurrentInsName,NewInsName,
@ -1841,8 +1845,9 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
else // The same name else // The same name
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_institution_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentInsName); Txt_The_name_of_the_institution_X_has_not_changed,
CurrentInsName);
} }
} }
} }
@ -1903,14 +1908,16 @@ void Ins_ChangeInsCtyInConfig (void)
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.CurrentIns.Ins.ShrtName,-1L,NewCty.CtyCod)) if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.CurrentIns.Ins.ShrtName,-1L,NewCty.CtyCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentIns.Ins.ShrtName); Txt_The_institution_X_already_exists,
Gbl.CurrentIns.Ins.ShrtName);
} }
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.CurrentIns.Ins.FullName,-1L,NewCty.CtyCod)) else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.CurrentIns.Ins.FullName,-1L,NewCty.CtyCod))
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentIns.Ins.FullName); Txt_The_institution_X_already_exists,
Gbl.CurrentIns.Ins.FullName);
} }
else else
{ {
@ -1924,8 +1931,9 @@ void Ins_ChangeInsCtyInConfig (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_country_of_the_institution_X_has_changed_to_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentIns.Ins.FullName,NewCty.Name[Gbl.Prefs.Language]); Txt_The_country_of_the_institution_X_has_changed_to_Y,
Gbl.CurrentIns.Ins.FullName,NewCty.Name[Gbl.Prefs.Language]);
} }
} }
} }
@ -1988,7 +1996,9 @@ void Ins_ChangeInsWWW (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to institution changed *****/ and put button to go to institution changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ins_ShowAlertAndButtonToGoToIns (); Ins_ShowAlertAndButtonToGoToIns ();
} }
else else
@ -2017,7 +2027,9 @@ void Ins_ChangeInsWWWInConfig (void)
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2079,8 +2091,9 @@ void Ins_ChangeInsStatus (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to institution changed *****/ and put button to go to institution changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_institution_X_has_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Inss.EditingIns.ShrtName); Txt_The_status_of_the_institution_X_has_changed,
Gbl.Inss.EditingIns.ShrtName);
Ins_ShowAlertAndButtonToGoToIns (); Ins_ShowAlertAndButtonToGoToIns ();
/***** Show the form again *****/ /***** Show the form again *****/
@ -2358,14 +2371,16 @@ static void Ins_RecFormRequestOrCreateIns (unsigned Status)
/***** If name of institution was in database... *****/ /***** If name of institution was in database... *****/
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.Inss.EditingIns.ShrtName,-1L,Gbl.CurrentCty.Cty.CtyCod)) if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.Inss.EditingIns.ShrtName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Inss.EditingIns.ShrtName); Txt_The_institution_X_already_exists,
Gbl.Inss.EditingIns.ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.Inss.EditingIns.FullName,-1L,Gbl.CurrentCty.Cty.CtyCod)) else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.Inss.EditingIns.FullName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Inss.EditingIns.FullName); Txt_The_institution_X_already_exists,
Gbl.Inss.EditingIns.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new institution to database else // Add new institution to database
@ -2410,8 +2425,9 @@ static void Ins_CreateInstitution (unsigned Status)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to institution created *****/ and put button to go to institution created *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_institution_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Inss.EditingIns.FullName); Txt_Created_new_institution_X,
Gbl.Inss.EditingIns.FullName);
Ins_ShowAlertAndButtonToGoToIns (); Ins_ShowAlertAndButtonToGoToIns ();
} }

View File

@ -503,8 +503,9 @@ void Lnk_RemoveLink (void)
DB_QueryDELETE (Query,"can not remove an institutional link"); DB_QueryDELETE (Query,"can not remove an institutional link");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Link_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Lnk.ShrtName); Txt_Link_X_removed,
Lnk.ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -577,8 +578,9 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewLnkName[0]) if (!NewLnkName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_link_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentLnkName); Txt_You_can_not_leave_the_name_of_the_link_X_empty,
CurrentLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -589,8 +591,9 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If link was in database... *****/ /***** If link was in database... *****/
if (Lnk_CheckIfLinkNameExists (ParamName,NewLnkName,Lnk->LnkCod)) if (Lnk_CheckIfLinkNameExists (ParamName,NewLnkName,Lnk->LnkCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewLnkName); Txt_The_link_X_already_exists,
NewLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -599,15 +602,17 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
Lnk_UpdateLnkNameDB (Lnk->LnkCod,FieldName,NewLnkName); Lnk_UpdateLnkNameDB (Lnk->LnkCod,FieldName,NewLnkName);
/* Write message to show the change made */ /* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_link_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentLnkName,NewLnkName); Txt_The_link_X_has_been_renamed_as_Y,
CurrentLnkName,NewLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_link_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentLnkName); Txt_The_name_of_the_link_X_has_not_changed,
CurrentLnkName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -677,8 +682,9 @@ void Lnk_ChangeLinkWWW (void)
DB_QueryUPDATE (Query,"can not update the web of an institutional link"); DB_QueryUPDATE (Query,"can not update the web of an institutional link");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewWWW); Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -813,14 +819,16 @@ void Lnk_RecFormNewLink (void)
/***** If name of link was in database... *****/ /***** If name of link was in database... *****/
if (Lnk_CheckIfLinkNameExists ("ShortName",Lnk->ShrtName,-1L)) if (Lnk_CheckIfLinkNameExists ("ShortName",Lnk->ShrtName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Lnk->ShrtName); Txt_The_link_X_already_exists,
Lnk->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Lnk_CheckIfLinkNameExists ("FullName",Lnk->FullName,-1L)) else if (Lnk_CheckIfLinkNameExists ("FullName",Lnk->FullName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Lnk->FullName); Txt_The_link_X_already_exists,
Lnk->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (!Lnk->WWW[0]) else if (!Lnk->WWW[0])
@ -856,7 +864,8 @@ static void Lnk_CreateLink (struct Link *Lnk)
DB_QueryINSERT (Query,"can not create institutional link"); DB_QueryINSERT (Query,"can not create institutional link");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_link_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Lnk->ShrtName); Txt_Created_new_link_X,
Lnk->ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -288,8 +288,9 @@ void Log_RequestLogo (Sco_Scope_t Scope)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/ /***** Write help message *****/
sprintf (Gbl.Alert.Txt,Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
64,64); Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y,
64,64);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Upload logo *****/ /***** Upload logo *****/
@ -377,7 +378,9 @@ void Log_ReceiveLogo (Sco_Scope_t Scope)
WrongType = true; WrongType = true;
if (WrongType) if (WrongType)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"png"); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_is_not_X,
"png");
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else

View File

@ -376,12 +376,13 @@ void Mai_WriteWarningEmailNotifications (void)
Tab_Tab_t TabMyAccount = Act_GetTab (ActFrmMyAcc ); Tab_Tab_t TabMyAccount = Act_GetTab (ActFrmMyAcc );
Tab_Tab_t TabMailDomains = Act_GetTab (ActSeeMai); Tab_Tab_t TabMailDomains = Act_GetTab (ActSeeMai);
sprintf (Gbl.Alert.Txt,Txt_You_can_only_receive_email_notifications_if_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_TABS_TXT [TabMyAccount ], Txt_You_can_only_receive_email_notifications_if_,
Txt_MENU_TITLE[TabMyAccount ][Act_GetIndexInMenu (ActFrmMyAcc)], Txt_TABS_TXT [TabMyAccount ],
Txt_TABS_TXT [TabMailDomains], Txt_MENU_TITLE[TabMyAccount ][Act_GetIndexInMenu (ActFrmMyAcc)],
Txt_MENU_TITLE[TabMailDomains][Act_GetIndexInMenu (ActSeeMai )], Txt_TABS_TXT [TabMailDomains],
Txt_Domains); Txt_MENU_TITLE[TabMailDomains][Act_GetIndexInMenu (ActSeeMai )],
Txt_Domains);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
@ -559,8 +560,9 @@ void Mai_RemoveMailDomain (void)
DB_QueryDELETE (Query,"can not remove a mail domain"); DB_QueryDELETE (Query,"can not remove a mail domain");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Email_domain_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Mai.Domain); Txt_Email_domain_X_removed,
Mai.Domain);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -635,8 +637,9 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentMaiName); Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty,
CurrentMaiName);
} }
else else
{ {
@ -648,8 +651,9 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewMaiName); Txt_The_email_domain_X_already_exists,
NewMaiName);
} }
else else
{ {
@ -659,16 +663,18 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
/* Write message to show the change made */ /* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentMaiName,NewMaiName); Txt_The_email_domain_X_has_been_renamed_as_Y,
CurrentMaiName,NewMaiName);
} }
} }
else // The same name else // The same name
{ {
Gbl.Alert.Type = Ale_INFO; Gbl.Alert.Type = Ale_INFO;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentMaiName); Txt_The_email_domain_X_has_not_changed,
CurrentMaiName);
} }
} }
@ -821,14 +827,16 @@ void Mai_RecFormNewMailDomain (void)
/***** If name of mail was in database... *****/ /***** If name of mail was in database... *****/
if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L)) if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Mai->Domain); Txt_The_email_domain_X_already_exists,
Mai->Domain);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L)) else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Mai->Info); Txt_The_email_domain_X_already_exists,
Mai->Info);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new mail to database else // Add new mail to database
@ -861,8 +869,9 @@ static void Mai_CreateMailDomain (struct Mail *Mai)
DB_QueryINSERT (Query,"can not create mail domain"); DB_QueryINSERT (Query,"can not create mail domain");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_email_domain_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Mai->Domain); Txt_Created_new_email_domain_X,
Mai->Domain);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -1462,7 +1471,9 @@ static void Mai_RemoveEmail (struct UsrData *UsrDat)
/***** Show message *****/ /***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_Email_X_removed,Email); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Email_X_removed,
Email);
/***** Update list of emails *****/ /***** Update list of emails *****/
Mai_GetEmailFromUsrCod (UsrDat); Mai_GetEmailFromUsrCod (UsrDat);
@ -1558,8 +1569,9 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_matches_one_previously_registered, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewEmail); Txt_The_email_address_X_matches_one_previously_registered,
NewEmail);
} }
else else
{ {
@ -1568,8 +1580,9 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
/***** Email updated sucessfully *****/ /***** Email updated sucessfully *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_has_been_registered_successfully, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewEmail); Txt_The_email_address_X_has_been_registered_successfully,
NewEmail);
/***** Update list of emails *****/ /***** Update list of emails *****/
Mai_GetEmailFromUsrCod (UsrDat); Mai_GetEmailFromUsrCod (UsrDat);
@ -1583,8 +1596,9 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewEmail); Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
} }
} }
} }
@ -1592,8 +1606,9 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewEmail); Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
} }
} }
else else
@ -1731,8 +1746,9 @@ bool Mai_SendMailMsgToConfirmEmail (void)
Gbl.Usrs.Me.ConfirmEmailJustSent = true; Gbl.Usrs.Me.ConfirmEmailJustSent = true;
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Me.UsrDat.Email); Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
Gbl.Usrs.Me.UsrDat.Email);
return true; return true;
case 1: case 1:
Gbl.Alert.Type = Ale_ERROR; Gbl.Alert.Type = Ale_ERROR;
@ -1743,9 +1759,10 @@ bool Mai_SendMailMsgToConfirmEmail (void)
default: default:
Gbl.Alert.Type = Ale_ERROR; Gbl.Alert.Type = Ale_ERROR;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID; Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,"Internal error: an email message has not been sent successfully." snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
" Error code returned by the script: %d", "Internal error: an email message has not been sent successfully."
ReturnCode); " Error code returned by the script: %d",
ReturnCode);
return false; return false;
} }
} }
@ -1841,8 +1858,9 @@ void Mai_ConfirmEmail (void)
/***** Confirm email *****/ /***** Confirm email *****/
if (Confirmed) if (Confirmed)
sprintf (Gbl.Alert.Txt,Txt_Email_X_has_already_been_confirmed_before, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Email); Txt_Email_X_has_already_been_confirmed_before,
Email);
else else
{ {
sprintf (Query,"UPDATE usr_emails SET Confirmed='Y'" sprintf (Query,"UPDATE usr_emails SET Confirmed='Y'"
@ -1851,7 +1869,9 @@ void Mai_ConfirmEmail (void)
UsrCod,Email); UsrCod,Email);
DB_QueryUPDATE (Query,"can not confirm email"); DB_QueryUPDATE (Query,"can not confirm email");
sprintf (Gbl.Alert.Txt,Txt_The_email_X_has_been_confirmed,Email); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_X_has_been_confirmed,
Email);
} }
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -281,8 +281,9 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
DB_QueryUPDATE (Query,"can not update properties of marks"); DB_QueryUPDATE (Query,"can not update properties of marks");
/***** Write message of success *****/ /***** Write message of success *****/
sprintf (Gbl.Alert.Txt,Txt_The_number_of_rows_is_now_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumRows); Txt_The_number_of_rows_is_now_X,
NumRows);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -399,8 +400,9 @@ bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks)
} }
/* /*
if (FileIsCorrect) if (FileIsCorrect)
sprintf (Gbl.Alert.Txt,Txt_X_header_rows_Y_student_rows_and_Z_footer_rows_found, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Marks->Header,NumRowsStds,Marks->Footer); Txt_X_header_rows_Y_student_rows_and_Z_footer_rows_found,
Marks->Header,NumRowsStds,Marks->Footer);
*/ */
return FileIsCorrect; return FileIsCorrect;
@ -599,8 +601,9 @@ static bool Mrk_GetUsrMarks (FILE *FileUsrMarks,struct UsrData *UsrDat,
/***** User's ID not found in table *****/ /***** User's ID not found in table *****/
fclose (FileAllMarks); fclose (FileAllMarks);
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_found_in_the_file_of_marks, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrDat->FullName); Txt_THE_USER_X_is_not_found_in_the_file_of_marks,
UsrDat->FullName);
return false; return false;
} }

View File

@ -750,7 +750,9 @@ void Msg_RecMsgFromUsr (void)
if (RecipientHasBannedMe) if (RecipientHasBannedMe)
{ {
/***** Show an alert indicating that the message has not been sent successfully *****/ /***** Show an alert indicating that the message has not been sent successfully *****/
sprintf (Gbl.Alert.Txt,Txt_message_not_sent_to_X,UsrDstData.FullName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_message_not_sent_to_X,
UsrDstData.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -786,9 +788,10 @@ void Msg_RecMsgFromUsr (void)
0)); 0));
/***** Show an alert indicating that the message has been sent successfully *****/ /***** Show an alert indicating that the message has been sent successfully *****/
sprintf (Gbl.Alert.Txt,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email : snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_message_sent_to_X_not_notified_by_email, NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
UsrDstData.FullName); Txt_message_sent_to_X_not_notified_by_email,
UsrDstData.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Increment number of recipients *****/ /***** Increment number of recipients *****/
@ -826,8 +829,9 @@ void Msg_RecMsgFromUsr (void)
Ale_ShowAlert (Ale_SUCCESS,Txt_The_message_has_been_sent_to_1_recipient); Ale_ShowAlert (Ale_SUCCESS,Txt_The_message_has_been_sent_to_1_recipient);
else else
{ {
sprintf (Gbl.Alert.Txt,Txt_The_message_has_been_sent_to_X_recipients, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned) NumRecipients); Txt_The_message_has_been_sent_to_X_recipients,
(unsigned) NumRecipients);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
@ -837,8 +841,9 @@ void Msg_RecMsgFromUsr (void)
/***** Show alert about errors on sending message *****/ /***** Show alert about errors on sending message *****/
if (NumErrors > 1) if (NumErrors > 1)
{ {
sprintf (Gbl.Alert.Txt,Txt_There_have_been_X_errors_in_sending_the_message, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned) NumErrors); Txt_There_have_been_X_errors_in_sending_the_message,
(unsigned) NumErrors);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
} }
@ -867,28 +872,32 @@ void Msg_ReqDelAllRecMsgs (void)
if (Gbl.Msg.FilterContent[0]) if (Gbl.Msg.FilterContent[0])
{ {
if (Gbl.Msg.ShowOnlyUnreadMsgs) if (Gbl.Msg.ShowOnlyUnreadMsgs)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo : Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Txt_any_user, Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent); Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
else else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo : Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Txt_any_user, Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent); Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
} }
else else
{ {
if (Gbl.Msg.ShowOnlyUnreadMsgs) if (Gbl.Msg.ShowOnlyUnreadMsgs)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo : Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
Txt_any_user, Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Gbl.Msg.FilterCrsShrtName); Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
else else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo : Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
Txt_any_user, Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Gbl.Msg.FilterCrsShrtName); Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
} }
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
@ -921,15 +930,17 @@ void Msg_ReqDelAllSntMsgs (void)
/***** Show question and button to remove messages received *****/ /***** Show question and button to remove messages received *****/
/* Start alert */ /* Start alert */
if (Gbl.Msg.FilterContent[0]) if (Gbl.Msg.FilterContent[0])
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo : Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Txt_any_user, Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent); Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
else else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo : Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
Txt_any_user, Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Gbl.Msg.FilterCrsShrtName); Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show sent messages again */ /* Show sent messages again */
@ -998,8 +1009,9 @@ static void Msg_ShowNumMsgsDeleted (unsigned NumMsgs)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_message_has_been_deleted); Ale_ShowAlert (Ale_SUCCESS,Txt_One_message_has_been_deleted);
else else
{ {
sprintf (Gbl.Alert.Txt,Txt_X_messages_have_been_deleted, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumMsgs); Txt_X_messages_have_been_deleted,
NumMsgs);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
@ -3645,8 +3657,9 @@ void Msg_BanSenderWhenShowingMsgs (void)
DB_QueryREPLACE (Query,"can not ban sender"); DB_QueryREPLACE (Query,"can not ban sender");
/***** Show alert with the change made *****/ /***** Show alert with the change made *****/
sprintf (Gbl.Alert.Txt,Txt_From_this_time_you_will_not_receive_messages_from_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName); Txt_From_this_time_you_will_not_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/**** Show received messages again */ /**** Show received messages again */
@ -3702,8 +3715,9 @@ static void Msg_UnbanSender (void)
DB_QueryDELETE (Query,"can not ban sender"); DB_QueryDELETE (Query,"can not ban sender");
/***** Show alert with the change made *****/ /***** Show alert with the change made *****/
sprintf (Gbl.Alert.Txt,Txt_From_this_time_you_can_receive_messages_from_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName); Txt_From_this_time_you_can_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -441,7 +441,9 @@ void Nck_RemoveMyNick (void)
/***** Show message *****/ /***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID; Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_Nickname_X_removed,NicknameWithoutArroba); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Nickname_X_removed,
NicknameWithoutArroba);
} }
else else
{ {
@ -480,7 +482,9 @@ void Nck_RemoveOtherUsrNick (void)
/***** Show message *****/ /***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID; Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_Nickname_X_removed,NicknameWithoutArroba); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Nickname_X_removed,
NicknameWithoutArroba);
/***** Show user's account again *****/ /***** Show user's account again *****/
Acc_ShowFormChgOtherUsrAccount (); Acc_ShowFormChgOtherUsrAccount ();
@ -575,8 +579,9 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID; Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_matches_the_one_you_had_previously_registered, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNicknameWithoutArroba); Txt_The_nickname_X_matches_the_one_you_had_previously_registered,
NewNicknameWithoutArroba);
} }
else if (strcasecmp (UsrDat->Nickname,NewNicknameWithoutArroba)) // User's nickname does not match, not even case insensitive, the new nickname else if (strcasecmp (UsrDat->Nickname,NewNicknameWithoutArroba)) // User's nickname does not match, not even case insensitive, the new nickname
{ {
@ -594,8 +599,9 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID; Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNicknameWithoutArroba); Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
} }
} }
} }
@ -609,18 +615,20 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID; Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_has_been_registered_successfully, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNicknameWithoutArroba); Txt_The_nickname_X_has_been_registered_successfully,
NewNicknameWithoutArroba);
} }
} }
else // New nickname is not valid else // New nickname is not valid
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID; Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewNicknameWithArroba, Txt_The_nickname_entered_X_is_not_valid_,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA, NewNicknameWithArroba,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA); Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
} }
} }

View File

@ -95,8 +95,9 @@ void Not_ShowFormNotice (void)
extern const char *Txt_Create_notice; extern const char *Txt_Create_notice;
/***** Help message *****/ /***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_The_notice_will_appear_as_a_yellow_note_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName); Txt_The_notice_will_appear_as_a_yellow_note_,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
/***** Start form *****/ /***** Start form *****/

View File

@ -555,9 +555,10 @@ unsigned Par_GetParameter (tParamType ParamType,const char *ParamName,
/* Check if there is space to copy separator */ /* Check if there is space to copy separator */
if (BytesAlreadyCopied + 1 > MaxBytes) if (BytesAlreadyCopied + 1 > MaxBytes)
{ {
sprintf (Gbl.Alert.Txt,"Multiple parameter <strong>%s</strong> too large," snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
" it exceed the maximum allowed size (%lu bytes).", "Multiple parameter <strong>%s</strong> too large,"
ParamName,(unsigned long) MaxBytes); " it exceed the maximum allowed size (%lu bytes).",
ParamName,(unsigned long) MaxBytes);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
@ -573,9 +574,10 @@ unsigned Par_GetParameter (tParamType ParamType,const char *ParamName,
/* Check if there is space to copy the parameter value */ /* Check if there is space to copy the parameter value */
if (BytesAlreadyCopied + Param->Value.Length > MaxBytes) if (BytesAlreadyCopied + Param->Value.Length > MaxBytes)
{ {
sprintf (Gbl.Alert.Txt,"Parameter <strong>%s</strong> too large," snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
" it exceed the maximum allowed size (%lu bytes).", "Parameter <strong>%s</strong> too large,"
ParamName,(unsigned long) MaxBytes); " it exceed the maximum allowed size (%lu bytes).",
ParamName,(unsigned long) MaxBytes);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }

View File

@ -403,9 +403,10 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
Ale_ShowAlert (Ale_WARNING,Txt_There_was_a_problem_sending_an_email_automatically); Ale_ShowAlert (Ale_WARNING,Txt_There_was_a_problem_sending_an_email_automatically);
break; break;
default: default:
sprintf (Gbl.Alert.Txt,"Internal error: an email message has not been sent successfully." snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
" Error code returned by the script: %d", "Internal error: an email message has not been sent successfully."
ReturnCode); " Error code returned by the script: %d",
ReturnCode);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
break; break;
} }
@ -418,8 +419,9 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
/***** Help message *****/ /***** Help message *****/
// TODO: This message allows to know if a ID exists in database (when no unique). // TODO: This message allows to know if a ID exists in database (when no unique).
// This should be hidden! // This should be hidden!
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Me.UsrIdLogin); Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
Gbl.Usrs.Me.UsrIdLogin);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Pwd_ShowFormSendNewPwd (); Pwd_ShowFormSendNewPwd ();
@ -629,8 +631,9 @@ bool Pwd_FastCheckIfPasswordSeemsGood (const char *PlainPassword)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Pwd_PASSWORD_SECTION_ID; Gbl.Alert.Section = Pwd_PASSWORD_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_password_must_be_at_least_X_characters, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Pwd_MIN_CHARS_PLAIN_PASSWORD); Txt_The_password_must_be_at_least_X_characters,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
return false; return false;
} }
@ -729,8 +732,9 @@ void Pwd_ShowFormChgMyPwd (void)
/***** Help message *****/ /***** Help message *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">"); "<td colspan=\"2\">");
sprintf (Gbl.Alert.Txt,Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Pwd_MIN_CHARS_PLAIN_PASSWORD); Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
@ -760,7 +764,9 @@ void Pwd_PutFormToGetNewPasswordOnce (void)
extern const char *Txt_Password; extern const char *Txt_Password;
extern const char *Txt_HELP_password; extern const char *Txt_HELP_password;
sprintf (Gbl.Alert.Txt,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_HELP_password,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">" "<td class=\"RIGHT_MIDDLE\">"
"<label for=\"Passwd\" class=\"%s\">%s:</label>" "<label for=\"Passwd\" class=\"%s\">%s:</label>"
@ -788,7 +794,9 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
extern const char *Txt_HELP_password; extern const char *Txt_HELP_password;
extern const char *Txt_Retype_new_password; extern const char *Txt_Retype_new_password;
sprintf (Gbl.Alert.Txt,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_HELP_password,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"REC_C1_BOT RIGHT_MIDDLE\">" "<td class=\"REC_C1_BOT RIGHT_MIDDLE\">"
"<label for=\"Paswd1\" class=\"%s\">%s:</label>" "<label for=\"Paswd1\" class=\"%s\">%s:</label>"

View File

@ -501,8 +501,9 @@ void Pho_ReqRemoveUsrPhoto (void)
{ {
/***** Show question and button to remove user's photo *****/ /***** Show question and button to remove user's photo *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_photo_of_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName); Txt_Do_you_really_want_to_remove_the_photo_of_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show current photo */ /* Show current photo */
@ -644,7 +645,9 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
WrongType = true; WrongType = true;
if (WrongType) if (WrongType)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"jpg"); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_is_not_X,
"jpg");
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
return false; return false;
} }
@ -726,9 +729,10 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
NumFacesTotal = NumFacesGreen = NumFacesRed = 0; NumFacesTotal = NumFacesGreen = NumFacesRed = 0;
break; break;
default: // Error default: // Error
sprintf (Gbl.Alert.Txt,"Photo could not be processed successfully.<br />" snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Error code returned by the program of processing: %d", "Photo could not be processed successfully.<br />"
ReturnCode); "Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
break; break;
} }
@ -760,24 +764,28 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
if (NumFacesRed == 0) if (NumFacesRed == 0)
{ {
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_X_faces_marked_in_green_have_been_detected_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumFacesGreen); Txt_X_faces_marked_in_green_have_been_detected_,
NumFacesGreen);
} }
else if (NumFacesGreen == 0) else if (NumFacesGreen == 0)
{ {
Gbl.Alert.Type = Ale_WARNING; Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_X_faces_marked_in_red_have_been_detected_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumFacesRed); Txt_X_faces_marked_in_red_have_been_detected_,
NumFacesRed);
} }
else // NumFacesGreen > 0 else // NumFacesGreen > 0
{ {
Gbl.Alert.Type = Ale_SUCCESS; Gbl.Alert.Type = Ale_SUCCESS;
if (NumFacesGreen == 1) if (NumFacesGreen == 1)
sprintf (Gbl.Alert.Txt,Txt_X_faces_have_been_detected_in_front_position_1_Z_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumFacesTotal,NumFacesRed); Txt_X_faces_have_been_detected_in_front_position_1_Z_,
NumFacesTotal,NumFacesRed);
else else
sprintf (Gbl.Alert.Txt,Txt_X_faces_have_been_detected_in_front_position_Y_Z_, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumFacesTotal,NumFacesGreen,NumFacesRed); Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
NumFacesTotal,NumFacesGreen,NumFacesRed);
} }
} }

View File

@ -577,8 +577,9 @@ void Plc_RemovePlace (void)
DB_QueryDELETE (Query,"can not remove a place"); DB_QueryDELETE (Query,"can not remove a place");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Place_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plc.FullName); Txt_Place_X_removed,
Plc.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -652,8 +653,9 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewPlcName[0]) if (!NewPlcName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_place_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentPlcName); Txt_You_can_not_leave_the_name_of_the_place_X_empty,
CurrentPlcName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -664,8 +666,9 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If place was in database... *****/ /***** If place was in database... *****/
if (Plc_CheckIfPlaceNameExists (ParamName,NewPlcName,Plc->PlcCod)) if (Plc_CheckIfPlaceNameExists (ParamName,NewPlcName,Plc->PlcCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewPlcName); Txt_The_place_X_already_exists,
NewPlcName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -674,15 +677,17 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
Plc_UpdatePlcNameDB (Plc->PlcCod,FieldName,NewPlcName); Plc_UpdatePlcNameDB (Plc->PlcCod,FieldName,NewPlcName);
/* Write message to show the change made */ /* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_place_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentPlcName,NewPlcName); Txt_The_place_X_has_been_renamed_as_Y,
CurrentPlcName,NewPlcName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_place_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
CurrentPlcName); Txt_The_name_of_the_place_X_has_not_changed,
CurrentPlcName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -839,14 +844,16 @@ void Plc_RecFormNewPlace (void)
/***** If name of place was in database... *****/ /***** If name of place was in database... *****/
if (Plc_CheckIfPlaceNameExists ("ShortName",Plc->ShrtName,-1L)) if (Plc_CheckIfPlaceNameExists ("ShortName",Plc->ShrtName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plc->ShrtName); Txt_The_place_X_already_exists,
Plc->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else if (Plc_CheckIfPlaceNameExists ("FullName",Plc->FullName,-1L)) else if (Plc_CheckIfPlaceNameExists ("FullName",Plc->FullName,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plc->FullName); Txt_The_place_X_already_exists,
Plc->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new place to database else // Add new place to database
@ -879,7 +886,8 @@ static void Plc_CreatePlace (struct Place *Plc)
DB_QueryINSERT (Query,"can not create place"); DB_QueryINSERT (Query,"can not create place");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_place_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plc->FullName); Txt_Created_new_place_X,
Plc->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -501,8 +501,9 @@ void Plg_RemovePlugin (void)
DB_QueryDELETE (Query,"can not remove a plugin"); DB_QueryDELETE (Query,"can not remove a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Plugin_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plg.Name); Txt_Plugin_X_removed,
Plg.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -539,8 +540,9 @@ void Plg_RenamePlugin (void)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewPlgName[0]) if (!NewPlgName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_plugin_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plg->Name); Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
Plg->Name);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -551,8 +553,9 @@ void Plg_RenamePlugin (void)
/***** If plugin was in database... *****/ /***** If plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (NewPlgName,Plg->PlgCod)) if (Plg_CheckIfPluginNameExists (NewPlgName,Plg->PlgCod))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewPlgName); Txt_The_plugin_X_already_exists,
NewPlgName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else
@ -563,15 +566,17 @@ void Plg_RenamePlugin (void)
DB_QueryUPDATE (Query,"can not update the name of a plugin"); DB_QueryUPDATE (Query,"can not update the name of a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plg->Name,NewPlgName); Txt_The_plugin_X_has_been_renamed_as_Y,
Plg->Name,NewPlgName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_plugin_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plg->Name); Txt_The_name_of_the_plugin_X_has_not_changed,
Plg->Name);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -628,8 +633,9 @@ void Plg_ChangePlgDescription (void)
DB_QueryUPDATE (Query,"can not update the description of a plugin"); DB_QueryUPDATE (Query,"can not update the description of a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_description_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewDescription); Txt_The_new_description_is_X,
NewDescription);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -672,8 +678,9 @@ void Plg_ChangePlgLogo (void)
DB_QueryUPDATE (Query,"can not update the logo of a plugin"); DB_QueryUPDATE (Query,"can not update the logo of a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_logo_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewLogo); Txt_The_new_logo_is_X,
NewLogo);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -716,8 +723,9 @@ void Plg_ChangePlgAppKey (void)
DB_QueryUPDATE (Query,"can not update the application key of a plugin"); DB_QueryUPDATE (Query,"can not update the application key of a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewAppKey); Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NewAppKey);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -760,8 +768,9 @@ void Plg_ChangePlgURL (void)
DB_QueryUPDATE (Query,"can not update the URL of a plugin"); DB_QueryUPDATE (Query,"can not update the URL of a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_URL_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewURL); Txt_The_new_URL_is_X,
NewURL);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -804,8 +813,9 @@ void Plg_ChangePlgIP (void)
DB_QueryUPDATE (Query,"can not update the IP address of a plugin"); DB_QueryUPDATE (Query,"can not update the IP address of a plugin");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_IP_address_is_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewIP); Txt_The_new_IP_address_is_X,
NewIP);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -1013,8 +1023,9 @@ void Plg_RecFormNewPlg (void)
/***** If name of plugin was in database... *****/ /***** If name of plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (Plg->Name,-1L)) if (Plg_CheckIfPluginNameExists (Plg->Name,-1L))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plg->Name); Txt_The_plugin_X_already_exists,
Plg->Name);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // Add new plugin to database else // Add new plugin to database
@ -1053,8 +1064,9 @@ static void Plg_CreatePlugin (struct Plugin *Plg)
DB_QueryINSERT (Query,"can not create plugin"); DB_QueryINSERT (Query,"can not create plugin");
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_plugin_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Plg->Name); Txt_Created_new_plugin_X,
Plg->Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -1981,9 +1981,10 @@ static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject)
Prj_FlushCacheMyRoleInProject (); Prj_FlushCacheMyRoleInProject ();
/* Show success alert */ /* Show success alert */
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_as_a_Y_in_the_project, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName, Txt_THE_USER_X_has_been_enroled_as_a_Y_in_the_project,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject]); Gbl.Usrs.Other.UsrDat.FullName,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject]);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -2054,11 +2055,11 @@ static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
/***** Show question and button to remove user as administrator *****/ /***** Show question and button to remove user as administrator *****/
/* Start alert */ /* Start alert */
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ItsMe ? Txt_Do_you_really_want_to_be_removed_as_a_X_from_the_project_Y : ItsMe ? Txt_Do_you_really_want_to_be_removed_as_a_X_from_the_project_Y :
Txt_Do_you_really_want_to_remove_the_following_user_as_a_X_from_the_project_Y, Txt_Do_you_really_want_to_remove_the_following_user_as_a_X_from_the_project_Y,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject], Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject],
Prj.Title); Prj.Title);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt); Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
/* Show user's record */ /* Show user's record */
@ -2146,10 +2147,11 @@ static void Prj_RemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
Prj_FlushCacheMyRoleInProject (); Prj_FlushCacheMyRoleInProject ();
/***** Show success alert *****/ /***** Show success alert *****/
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_a_Y_from_the_project_Z, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.FullName, Txt_THE_USER_X_has_been_removed_as_a_Y_from_the_project_Z,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject], Gbl.Usrs.Other.UsrDat.FullName,
Prj.Title); Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject],
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2731,8 +2733,9 @@ void Prj_ReqRemProject (void)
{ {
/***** Show question and button to remove the project *****/ /***** Show question and button to remove the project *****/
Gbl.Prjs.PrjCod = Prj.PrjCod; Gbl.Prjs.PrjCod = Prj.PrjCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_project_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Prj.Title); Txt_Do_you_really_want_to_remove_the_project_X,
Prj.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemPrj,NULL,NULL,Prj_PutCurrentParams, ActRemPrj,NULL,NULL,Prj_PutCurrentParams,
Btn_REMOVE_BUTTON,Txt_Remove_project); Btn_REMOVE_BUTTON,Txt_Remove_project);
@ -2797,8 +2800,9 @@ void Prj_RemoveProject (void)
Fil_RemoveTree (PathRelPrj); Fil_RemoveTree (PathRelPrj);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Project_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Prj.Title); Txt_Project_X_removed,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2841,8 +2845,9 @@ void Prj_HideProject (void)
DB_QueryUPDATE (Query,"can not hide project"); DB_QueryUPDATE (Query,"can not hide project");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Project_X_is_now_hidden, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Prj.Title); Txt_Project_X_is_now_hidden,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -2885,8 +2890,9 @@ void Prj_ShowProject (void)
DB_QueryUPDATE (Query,"can not show project"); DB_QueryUPDATE (Query,"can not show project");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Project_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Prj.Title); Txt_Project_X_is_now_visible,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
@ -3305,7 +3311,9 @@ void Prj_RecFormProject (void)
Prj_CreateProject (&Prj); // Add new project to database Prj_CreateProject (&Prj); // Add new project to database
/* Write success message */ /* Write success message */
sprintf (Gbl.Alert.Txt,Txt_Created_new_project_X,Prj.Title); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_project_X,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else if (NewProjectIsCorrect) else if (NewProjectIsCorrect)

View File

@ -202,8 +202,9 @@ void Rec_ReqEditRecordFields (void)
} }
else // No fields of records found for current course in the database else // No fields of records found for current course in the database
{ {
sprintf (Gbl.Alert.Txt,Txt_There_are_no_record_fields_in_the_course_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Crs.FullName); Txt_There_are_no_record_fields_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
@ -482,8 +483,9 @@ void Rec_ReceiveFormField (void)
/***** If the field already was in the database... *****/ /***** If the field already was in the database... *****/
if (Rec_CheckIfRecordFieldIsRepeated (Gbl.CurrentCrs.Records.Field.Name)) if (Rec_CheckIfRecordFieldIsRepeated (Gbl.CurrentCrs.Records.Field.Name))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_The_record_field_X_already_exists,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
else // Add the new field to the database else // Add the new field to the database
@ -586,8 +588,9 @@ void Rec_CreateRecordField (void)
DB_QueryINSERT (Query,"can not create field of record"); DB_QueryINSERT (Query,"can not create field of record");
/***** Write message of success *****/ /***** Write message of success *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_record_field_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_Created_new_record_field_X,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -655,8 +658,9 @@ void Rec_AskConfirmRemFieldWithRecords (unsigned NumRecords)
&Gbl.CurrentCrs.Records.Field.Visibility); &Gbl.CurrentCrs.Records.Field.Visibility);
/***** Show question and button to remove my photo *****/ /***** Show question and button to remove my photo *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name,Gbl.CurrentCrs.Crs.FullName); Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_X,
Gbl.CurrentCrs.Records.Field.Name,Gbl.CurrentCrs.Crs.FullName);
if (NumRecords == 1) if (NumRecords == 1)
Str_Concat (Gbl.Alert.Txt,Txt_this_field_is_filled_in_the_record_of_one_student, Str_Concat (Gbl.Alert.Txt,Txt_this_field_is_filled_in_the_record_of_one_student,
Ale_MAX_BYTES_ALERT); Ale_MAX_BYTES_ALERT);
@ -701,8 +705,9 @@ void Rec_RemoveFieldFromDB (void)
DB_QueryDELETE (Query,"can not remove field of record"); DB_QueryDELETE (Query,"can not remove field of record");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Record_field_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_Record_field_X_removed,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
@ -807,8 +812,9 @@ void Rec_RenameField (void)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewFieldName[0]) if (!NewFieldName[0])
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_field_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_You_can_not_leave_the_name_of_the_field_X_empty,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
else else
@ -820,8 +826,9 @@ void Rec_RenameField (void)
/***** If the group ya estaba in the database... *****/ /***** If the group ya estaba in the database... *****/
if (Rec_CheckIfRecordFieldIsRepeated (NewFieldName)) if (Rec_CheckIfRecordFieldIsRepeated (NewFieldName))
{ {
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_already_exists, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewFieldName); Txt_The_record_field_X_already_exists,
NewFieldName);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
else else
@ -833,15 +840,17 @@ void Rec_RenameField (void)
DB_QueryUPDATE (Query,"can not update name of field of record"); DB_QueryUPDATE (Query,"can not update name of field of record");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name,NewFieldName); Txt_The_record_field_X_has_been_renamed_as_Y,
Gbl.CurrentCrs.Records.Field.Name,NewFieldName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ {
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_field_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewFieldName); Txt_The_name_of_the_field_X_has_not_changed,
NewFieldName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
} }
@ -882,8 +891,9 @@ void Rec_ChangeLinesField (void)
(this happens when return is pressed without changes) *****/ (this happens when return is pressed without changes) *****/
if (Gbl.CurrentCrs.Records.Field.NumLines == NewNumLines) if (Gbl.CurrentCrs.Records.Field.NumLines == NewNumLines)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else else
@ -895,8 +905,9 @@ void Rec_ChangeLinesField (void)
DB_QueryUPDATE (Query,"can not update the number of lines of a field of record"); DB_QueryUPDATE (Query,"can not update the number of lines of a field of record");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name,NewNumLines); Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y,
Gbl.CurrentCrs.Records.Field.Name,NewNumLines);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -935,8 +946,9 @@ void Rec_ChangeVisibilityField (void)
(this happens whe return is pressed without changes in the form) *****/ (this happens whe return is pressed without changes in the form) *****/
if (Gbl.CurrentCrs.Records.Field.Visibility == NewVisibility) if (Gbl.CurrentCrs.Records.Field.Visibility == NewVisibility)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_visibility_of_the_record_field_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_The_visibility_of_the_record_field_X_has_not_changed,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else else
@ -948,8 +960,9 @@ void Rec_ChangeVisibilityField (void)
DB_QueryUPDATE (Query,"can not update the visibility of a field of record"); DB_QueryUPDATE (Query,"can not update the visibility of a field of record");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility], snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.CurrentCrs.Records.Field.Name); Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility],
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -485,9 +485,10 @@ unsigned Ses_GetHiddenParFromDB (Act_Action_t NextAction,
if (ParameterIsTooBig) if (ParameterIsTooBig)
{ {
sprintf (Gbl.Alert.Txt,"Hidden parameter <strong>%s</strong> too large," snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
" it exceed the maximum allowed size (%lu bytes).", "Hidden parameter <strong>%s</strong> too large,"
ParamName,(unsigned long) MaxBytes); " it exceed the maximum allowed size (%lu bytes).",
ParamName,(unsigned long) MaxBytes);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }

View File

@ -1041,8 +1041,9 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
if (!ICanQueryWholeRange && NumDays > Cfg_DAYS_IN_RECENT_LOG) if (!ICanQueryWholeRange && NumDays > Cfg_DAYS_IN_RECENT_LOG)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_date_range_must_be_less_than_or_equal_to_X_days, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Cfg_DAYS_IN_RECENT_LOG); Txt_The_date_range_must_be_less_than_or_equal_to_X_days,
Cfg_DAYS_IN_RECENT_LOG);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); // ...write warning message and show the form again Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); // ...write warning message and show the form again
return; return;
} }

View File

@ -1038,7 +1038,9 @@ void Str_ChangeFormat (Str_ChangeFrom_t ChangeFrom,Str_ChangeTo_t ChangeTo,
/* /*
if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM) if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM)
{ {
sprintf (Gbl.Alert.Txt,"Str_ChangeFormat (&quot;%s&quot;)",Str); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Str_ChangeFormat (&quot;%s&quot;)",
Str);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt); Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
} }
*/ */
@ -2880,8 +2882,9 @@ void Str_Copy (char *Dst,const char *Src,size_t DstSize)
/***** Check if buffer has enough space for source *****/ /***** Check if buffer has enough space for source *****/
if (LengthSrc > DstSize) if (LengthSrc > DstSize)
{ {
sprintf (Gbl.Alert.Txt,"Trying to copy %lu chars into a %lu-chars buffer.", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
LengthSrc,DstSize); "Trying to copy %lu chars into a %lu-chars buffer.",
LengthSrc,DstSize);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
@ -2903,8 +2906,9 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize)
LengthDst = strlen (Dst); LengthDst = strlen (Dst);
if (LengthDst > DstSize) if (LengthDst > DstSize)
{ {
sprintf (Gbl.Alert.Txt,"%lu-chars buffer has %lu chars!", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
DstSize,LengthDst); "%lu-chars buffer has %lu chars!",
DstSize,LengthDst);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
@ -2914,8 +2918,9 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize)
LengthSrc = strlen (Src); LengthSrc = strlen (Src);
if (FreeSpace < LengthSrc) if (FreeSpace < LengthSrc)
{ {
sprintf (Gbl.Alert.Txt,"Trying to concatenate %lu chars to a %lu-chars buffer with free space for only %lu chars!", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
LengthSrc,DstSize,FreeSpace); "Trying to concatenate %lu chars to a %lu-chars buffer with free space for only %lu chars!",
LengthSrc,DstSize,FreeSpace);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }

View File

@ -1508,8 +1508,9 @@ void Svy_AskRemSurvey (void)
/***** Show question and button to remove survey *****/ /***** Show question and button to remove survey *****/
Gbl.Svys.SvyCodToEdit = Svy.SvyCod; Gbl.Svys.SvyCodToEdit = Svy.SvyCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_survey_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy.Title); Txt_Do_you_really_want_to_remove_the_survey_X,
Svy.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemSvy,NULL,NULL,Svy_PutParams, ActRemSvy,NULL,NULL,Svy_PutParams,
Btn_REMOVE_BUTTON,Txt_Remove_survey); Btn_REMOVE_BUTTON,Txt_Remove_survey);
@ -1571,8 +1572,9 @@ void Svy_RemoveSurvey (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_SURVEY,Svy.SvyCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_SURVEY,Svy.SvyCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_removed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy.Title); Txt_Survey_X_removed,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/ /***** Show surveys again *****/
@ -1607,8 +1609,9 @@ void Svy_AskResetSurvey (void)
Lay_ShowErrorAndExit ("You can not reset this survey."); Lay_ShowErrorAndExit ("You can not reset this survey.");
/***** Ask for confirmation of reset *****/ /***** Ask for confirmation of reset *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reset_the_survey_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy.Title); Txt_Do_you_really_want_to_reset_the_survey_X,
Svy.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
/***** Button of confirmation of reset *****/ /***** Button of confirmation of reset *****/
@ -1669,8 +1672,9 @@ void Svy_ResetSurvey (void)
DB_QueryUPDATE (Query,"can not reset answers of a survey"); DB_QueryUPDATE (Query,"can not reset answers of a survey");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_reset, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy.Title); Txt_Survey_X_reset,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/ /***** Show surveys again *****/
@ -1706,8 +1710,9 @@ void Svy_HideSurvey (void)
DB_QueryUPDATE (Query,"can not hide survey"); DB_QueryUPDATE (Query,"can not hide survey");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_is_now_hidden, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy.Title); Txt_Survey_X_is_now_hidden,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/ /***** Show surveys again *****/
@ -1743,8 +1748,9 @@ void Svy_UnhideSurvey (void)
DB_QueryUPDATE (Query,"can not show survey"); DB_QueryUPDATE (Query,"can not show survey");
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_is_now_visible, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy.Title); Txt_Survey_X_is_now_visible,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/ /***** Show surveys again *****/
@ -2195,8 +2201,9 @@ void Svy_RecFormSurvey (void)
if (Svy_CheckIfSimilarSurveyExists (&NewSvy)) if (Svy_CheckIfSimilarSurveyExists (&NewSvy))
{ {
NewSurveyIsCorrect = false; NewSurveyIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_a_survey_with_the_title_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewSvy.Title); Txt_Already_existed_a_survey_with_the_title_X,
NewSvy.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
} }
@ -2281,8 +2288,9 @@ static void Svy_CreateSurvey (struct Survey *Svy,const char *Txt)
Svy_CreateGrps (Svy->SvyCod); Svy_CreateGrps (Svy->SvyCod);
/***** Write success message *****/ /***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_survey_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Svy->Title); Txt_Created_new_survey_X,
Svy->Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -2915,7 +2923,8 @@ static bool Svy_AllocateTextChoiceAnswer (struct SurveyQuestion *SvyQst,
Svy_FreeTextChoiceAnswer (SvyQst,NumAns); Svy_FreeTextChoiceAnswer (SvyQst,NumAns);
if ((SvyQst->AnsChoice[NumAns].Text = (char *) malloc (Svy_MAX_BYTES_ANSWER + 1)) == NULL) if ((SvyQst->AnsChoice[NumAns].Text = (char *) malloc (Svy_MAX_BYTES_ANSWER + 1)) == NULL)
{ {
sprintf (Gbl.Alert.Txt,"Not enough memory to store answer."); Str_Copy (Gbl.Alert.Txt,"Not enough memory to store answer.",
Ale_MAX_BYTES_ALERT);
return false; return false;
} }
SvyQst->AnsChoice[NumAns].Text[0] = '\0'; SvyQst->AnsChoice[NumAns].Text[0] = '\0';
@ -3586,8 +3595,9 @@ void Svy_RequestRemoveQst (void)
/***** Show question and button to remove question *****/ /***** Show question and button to remove question *****/
Gbl.Svys.SvyCodToEdit = SvyCod; Gbl.Svys.SvyCodToEdit = SvyCod;
Gbl.Svys.SvyQstCodToEdit = SvyQst.QstCod; Gbl.Svys.SvyQstCodToEdit = SvyQst.QstCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned long) (SvyQst.QstInd + 1)); Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) (SvyQst.QstInd + 1));
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemSvyQst,NULL,NULL,Svy_PutParamsRemoveOneQst, ActRemSvyQst,NULL,NULL,Svy_PutParamsRemoveOneQst,
Btn_REMOVE_BUTTON,Txt_Remove_question); Btn_REMOVE_BUTTON,Txt_Remove_question);

View File

@ -584,13 +584,15 @@ void Tst_AssessTest (void)
Tst_SetTstStatus (NumTst,Tst_STATUS_ASSESSED); Tst_SetTstStatus (NumTst,Tst_STATUS_ASSESSED);
break; break;
case Tst_STATUS_ASSESSED: case Tst_STATUS_ASSESSED:
sprintf (Gbl.Alert.Txt,Txt_The_test_X_has_already_been_assessed_previously, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumTst); Txt_The_test_X_has_already_been_assessed_previously,
NumTst);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
break; break;
case Tst_STATUS_ERROR: case Tst_STATUS_ERROR:
sprintf (Gbl.Alert.Txt,Txt_There_was_an_error_in_assessing_the_test_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumTst); Txt_There_was_an_error_in_assessing_the_test_X,
NumTst);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
break; break;
} }
@ -698,14 +700,15 @@ static bool Tst_CheckIfNextTstAllowed (void)
if (NumSecondsFromNowToNextAccTst > 0) if (NumSecondsFromNowToNextAccTst > 0)
{ {
/***** Write warning *****/ /***** Write warning *****/
sprintf (Gbl.Alert.Txt,"%s:<br /><span id=\"date_next_test\"></span>." snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"<script type=\"text/javascript\">" "%s:<br /><span id=\"date_next_test\"></span>."
"writeLocalDateHMSFromUTC('date_next_test',%ld," "<script type=\"text/javascript\">"
"%u,',&nbsp;','%s',true,true,0x7);" "writeLocalDateHMSFromUTC('date_next_test',%ld,"
"</script>", "%u,',&nbsp;','%s',true,true,0x7);"
Txt_You_can_not_take_a_new_test_until, "</script>",
(long) TimeNextTestUTC, Txt_You_can_not_take_a_new_test_until,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today); (long) TimeNextTestUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
return false; return false;
@ -1552,8 +1555,9 @@ void Tst_RenameTag (void)
/***** Check that the new tag is not empty *****/ /***** Check that the new tag is not empty *****/
if (!NewTagTxt[0]) // New tag empty if (!NewTagTxt[0]) // New tag empty
{ {
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_tag_X_empty, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
OldTagTxt); Txt_You_can_not_leave_the_name_of_the_tag_X_empty,
OldTagTxt);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else // New tag not empty else // New tag not empty
@ -1564,8 +1568,9 @@ void Tst_RenameTag (void)
// This happens when user press INTRO // This happens when user press INTRO
// without changing anything in the form. // without changing anything in the form.
{ {
sprintf (Gbl.Alert.Txt,Txt_The_tag_X_has_not_changed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewTagTxt); Txt_The_tag_X_has_not_changed,
NewTagTxt);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else // The old and the new tag else // The old and the new tag
@ -1648,8 +1653,9 @@ void Tst_RenameTag (void)
} }
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_tag_X_has_been_renamed_as_Y, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
OldTagTxt,NewTagTxt); Txt_The_tag_X_has_been_renamed_as_Y,
OldTagTxt,NewTagTxt);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
@ -4760,8 +4766,9 @@ static bool Tst_GetParamsTst (Tst_ActionToDoWithQuestions_t ActionToDoWithQuesti
if (Gbl.Test.NumQsts < Gbl.Test.Config.Min || if (Gbl.Test.NumQsts < Gbl.Test.Config.Min ||
Gbl.Test.NumQsts > Gbl.Test.Config.Max) Gbl.Test.NumQsts > Gbl.Test.Config.Max)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_number_of_questions_must_be_in_the_interval_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Test.Config.Min,Gbl.Test.Config.Max); Txt_The_number_of_questions_must_be_in_the_interval_X,
Gbl.Test.Config.Min,Gbl.Test.Config.Max);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Error = true; Error = true;
} }
@ -5419,13 +5426,15 @@ int Tst_AllocateTextChoiceAnswer (unsigned NumOpt)
if ((Gbl.Test.Answer.Options[NumOpt].Text = if ((Gbl.Test.Answer.Options[NumOpt].Text =
(char *) malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL) (char *) malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL)
{ {
sprintf (Gbl.Alert.Txt,"Not enough memory to store answer."); Str_Copy (Gbl.Alert.Txt,"Not enough memory to store answer.",
Ale_MAX_BYTES_ALERT);
return 0; return 0;
} }
if ((Gbl.Test.Answer.Options[NumOpt].Feedback = if ((Gbl.Test.Answer.Options[NumOpt].Feedback =
(char *) malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL) (char *) malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL)
{ {
sprintf (Gbl.Alert.Txt,"Not enough memory to store feedback."); Str_Copy (Gbl.Alert.Txt,"Not enough memory to store feedback.",
Ale_MAX_BYTES_ALERT);
return 0; return 0;
} }
@ -6325,8 +6334,9 @@ void Tst_RequestRemoveQst (void)
Lay_ShowErrorAndExit ("Wrong test parameters."); Lay_ShowErrorAndExit ("Wrong test parameters.");
/***** Show question and button to remove question *****/ /***** Show question and button to remove question *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
(unsigned long) Gbl.Test.QstCod); Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) Gbl.Test.QstCod);
if (EditingOnlyThisQst) if (EditingOnlyThisQst)
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemTstQst,NULL,NULL, ActRemTstQst,NULL,NULL,
@ -6448,10 +6458,10 @@ void Tst_ChangeShuffleQst (void)
DB_QueryUPDATE (Query,"can not update the shuffle type of a question"); DB_QueryUPDATE (Query,"can not update the shuffle type of a question");
/***** Write message *****/ /***** Write message *****/
sprintf (Gbl.Alert.Txt, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Shuffle ? Txt_The_answers_of_the_question_with_code_X_will_appear_shuffled : Shuffle ? Txt_The_answers_of_the_question_with_code_X_will_appear_shuffled :
Txt_The_answers_of_the_question_with_code_X_will_appear_without_shuffling, Txt_The_answers_of_the_question_with_code_X_will_appear_without_shuffling,
Gbl.Test.QstCod); Gbl.Test.QstCod);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Continue editing questions *****/ /***** Continue editing questions *****/

View File

@ -426,7 +426,9 @@ void TsI_ImportQstsFromXML (void)
if (WrongType) if (WrongType)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"xml"); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_is_not_X,
"xml");
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
else else

View File

@ -2473,12 +2473,14 @@ void Usr_WelcomeUsr (void)
Gbl.Prefs.PathIconSet,Cfg_ICON_128x128, Gbl.Prefs.PathIconSet,Cfg_ICON_128x128,
Txt_Happy_birthday, Txt_Happy_birthday,
Txt_Happy_birthday); Txt_Happy_birthday);
sprintf (Gbl.Alert.Txt,Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex], snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Me.UsrDat.FirstName); Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex],
Gbl.Usrs.Me.UsrDat.FirstName);
} }
if (!CongratulateMyBirthday) if (!CongratulateMyBirthday)
sprintf (Gbl.Alert.Txt,Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex], snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Me.UsrDat.FirstName); Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex],
Gbl.Usrs.Me.UsrDat.FirstName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt); Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
} }
else else
@ -2749,8 +2751,9 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
if (Wrong) if (Wrong)
{ {
/***** String is not a valid user's nickname, email or ID *****/ /***** String is not a valid user's nickname, email or ID *****/
sprintf (Gbl.Alert.Txt,Txt_The_ID_nickname_or_email_X_is_not_valid, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail); Txt_The_ID_nickname_or_email_X_is_not_valid,
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
@ -3182,8 +3185,9 @@ static void Usr_ShowAlertThereAreMoreThanOneUsr (void)
Gbl.Action.Act = ActFrmLogIn; Gbl.Action.Act = ActFrmLogIn;
Tab_SetCurrentTab (); Tab_SetCurrentTab ();
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.Me.UsrIdLogin); Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
Gbl.Usrs.Me.UsrIdLogin);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
@ -3277,9 +3281,10 @@ void Usr_ShowFormsLogoutAndRole (void)
/***** Write message with my new logged role *****/ /***** Write message with my new logged role *****/
if (Gbl.Usrs.Me.Role.HasChanged) if (Gbl.Usrs.Me.Role.HasChanged)
{ {
sprintf (Gbl.Alert.Txt,Txt_You_are_now_LOGGED_IN_as_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_logged[Gbl.Usrs.Me.UsrDat.Sex], Txt_You_are_now_LOGGED_IN_as_X,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.Role.Logged][Gbl.Usrs.Me.UsrDat.Sex]); Txt_logged[Gbl.Usrs.Me.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.Role.Logged][Gbl.Usrs.Me.UsrDat.Sex]);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt); Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
} }
@ -5130,8 +5135,9 @@ static void Usr_GetListUsrsFromQuery (const char *Query,Rol_Role_t Role,Sco_Scop
{ {
if (Gbl.Usrs.LstUsrs[Role].NumUsrs > Cfg_MAX_USRS_IN_LIST) if (Gbl.Usrs.LstUsrs[Role].NumUsrs > Cfg_MAX_USRS_IN_LIST)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_users_is_too_large_to_be_displayed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Gbl.Usrs.LstUsrs[Role].NumUsrs); Txt_The_list_of_X_users_is_too_large_to_be_displayed,
Gbl.Usrs.LstUsrs[Role].NumUsrs);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Abort = true; Abort = true;
} }
@ -5319,7 +5325,9 @@ static void Usr_AllocateUsrsList (Rol_Role_t Role)
/* /*
if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM) if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM)
{ {
sprintf (Gbl.Alert.Txt,"Memory used by list = %lu",(long) sizeof (struct UsrInList) * NumUsrs); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Memory used by list = %lu",
(long) sizeof (struct UsrInList) * NumUsrs);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt); Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
} }
*/ */
@ -5380,8 +5388,9 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs,const char
extern const char *Txt_Show_anyway; extern const char *Txt_Show_anyway;
/***** Show alert and button to confirm that I want to see the big list *****/ /***** Show alert and button to confirm that I want to see the big list *****/
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_users_is_too_large_to_be_displayed, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NumUsrs); Txt_The_list_of_X_users_is_too_large_to_be_displayed,
NumUsrs);
Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt, Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt,
Gbl.Action.Act,Usr_USER_LIST_SECTION_ID,OnSubmit, Gbl.Action.Act,Usr_USER_LIST_SECTION_ID,OnSubmit,
Usr_PutParamsConfirmIWantToSeeBigList, Usr_PutParamsConfirmIWantToSeeBigList,
@ -5525,8 +5534,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{ {
if (WriteErrorMsgs) if (WriteErrorMsgs)
{ {
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_nickname_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrIDNickOrEmail); Txt_There_is_no_user_with_nickname_X,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
Error = true; Error = true;
@ -5544,8 +5554,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{ {
if (WriteErrorMsgs) if (WriteErrorMsgs)
{ {
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_email_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrIDNickOrEmail); Txt_There_is_no_user_with_email_X,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
Error = true; Error = true;
@ -5572,8 +5583,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{// TODO: Consider forbid IDs here {// TODO: Consider forbid IDs here
if (WriteErrorMsgs) if (WriteErrorMsgs)
{ {
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrIDNickOrEmail); Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
Error = true; Error = true;
@ -5583,8 +5595,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{ {
if (WriteErrorMsgs) if (WriteErrorMsgs)
{ {
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_ID_nick_or_email_X, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrIDNickOrEmail); Txt_There_is_no_user_with_ID_nick_or_email_X,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt); Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
} }
Error = true; Error = true;
@ -5594,8 +5607,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{ {
if (WriteErrorMsgs) if (WriteErrorMsgs)
{ {
sprintf (Gbl.Alert.Txt,Txt_The_ID_nickname_or_email_X_is_not_valid, snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
UsrIDNickOrEmail); Txt_The_ID_nickname_or_email_X_is_not_valid,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
} }
Error = true; Error = true;

View File

@ -151,12 +151,16 @@ static void XML_GetElement (struct XMLElement *ParentElem)
EndTagNameLength = strcspn (Gbl.XMLPtr,">"); EndTagNameLength = strcspn (Gbl.XMLPtr,">");
if (ParentElem->TagNameLength != EndTagNameLength) if (ParentElem->TagNameLength != EndTagNameLength)
{ {
sprintf (Gbl.Alert.Txt,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"XML syntax error. Expect end tag &lt;/%s&gt;.",
ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
if (strncmp (ParentElem->TagName,Gbl.XMLPtr,EndTagNameLength)) // XML tags are case sensitive if (strncmp (ParentElem->TagName,Gbl.XMLPtr,EndTagNameLength)) // XML tags are case sensitive
{ {
sprintf (Gbl.Alert.Txt,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName); snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"XML syntax error. Expect end tag &lt;/%s&gt;.",
ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }
@ -360,8 +364,9 @@ static void XML_GetAttributes (struct XMLElement *Elem)
} }
else else
{ {
sprintf (Gbl.Alert.Txt,"XML syntax error after attribute &quot;%s&quot; inside element &quot;%s&quot;.", snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Attribute->AttributeName,Elem->TagName); "XML syntax error after attribute &quot;%s&quot; inside element &quot;%s&quot;.",
Attribute->AttributeName,Elem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt); Lay_ShowErrorAndExit (Gbl.Alert.Txt);
} }