Version 16.211

This commit is contained in:
Antonio Cañas Vargas 2017-05-10 10:25:01 +02:00
parent 41b15cf330
commit c5cb0e6415
53 changed files with 1060 additions and 1050 deletions

View File

@ -747,8 +747,8 @@ static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe)
ID_RemoveUsrIDFromDB (UsrDat->UsrCod,UsrID);
/***** Show message *****/
sprintf (Gbl.Message,Txt_ID_X_removed,UsrID);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_ID_X_removed,UsrID);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_delete_this_ID);
@ -872,21 +872,21 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
if (ItsMe || UsrDat->IDs.List[NumIDFound].Confirmed)
{
Error = true;
sprintf (Gbl.Message,Txt_The_ID_X_matches_one_of_the_existing,
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_matches_one_of_the_existing,
NewID);
}
else // It's not me && !Confirmed
{
/***** Mark this ID as confirmed *****/
ID_ConfirmUsrID (UsrDat,NewID);
sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed,
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed,
NewID);
}
}
else if (UsrDat->IDs.Num >= ID_MAX_IDS_PER_USER)
{
Error = true;
sprintf (Gbl.Message,Txt_A_user_can_not_have_more_than_X_IDs,
sprintf (Gbl.Alert.Txt,Txt_A_user_can_not_have_more_than_X_IDs,
ID_MAX_IDS_PER_USER);
}
else // OK ==> add this new ID to my list of IDs
@ -896,20 +896,20 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
// It's not me ==> ID confirmed
ID_InsertANewUsrIDInDB (UsrDat->UsrCod,NewID,!ItsMe);
sprintf (Gbl.Message,Txt_The_ID_X_has_been_registered_successfully,
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_registered_successfully,
NewID);
}
}
else // New ID is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_ID_X_is_not_valid,NewID);
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,NewID);
}
/***** Show message *****/
Lay_ShowAlert (Error ? Lay_WARNING :
Lay_SUCCESS,
Gbl.Message);
Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
@ -951,7 +951,7 @@ void ID_ConfirmOtherUsrID (void)
unsigned NumIDFound = 0; // Initialized to avoid warning
/***** Initialize alert type and message *****/
Gbl.AlertType = Lay_NONE; // Do not show alert
Gbl.Alert.Type = Lay_NONE; // Do not show alert
/***** Get where we came from *****/
OriginalActCod = Par_GetParToLong ("OriginalActCod");
@ -986,8 +986,8 @@ void ID_ConfirmOtherUsrID (void)
if (Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed)
{
/***** ID found and already confirmed *****/
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_ID_X_had_already_been_confirmed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_ID_X_had_already_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
else
@ -998,21 +998,21 @@ void ID_ConfirmOtherUsrID (void)
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed = true;
/***** Write success message *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
}
else // User's ID not found
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
}
else // I can not confirm
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
/***** Show one or multiple records *****/

View File

@ -242,9 +242,9 @@ void Acc_CheckIfEmptyAccountExists (void)
}
else
{
sprintf (Gbl.Message,Txt_There_is_no_empty_account_associated_with_your_ID_X_,
sprintf (Gbl.Alert.Txt,Txt_There_is_no_empty_account_associated_with_your_ID_X_,
ID);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** Free structure that stores the query result *****/
@ -633,19 +633,19 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (DB_QueryCOUNT (Query,"can not check if nickname already existed")) // A nickname of another user is the same that this nickname
{
Error = true;
sprintf (Gbl.Message,Txt_The_nickname_X_had_been_registered_by_another_user,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // New nickname is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_nickname_entered_X_is_not_valid_,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_,
NewNicknameWithArroba,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Step 2/3: Get new email from form *****/
@ -661,17 +661,17 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email
{
Error = true;
sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // New email is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Step 3/3: Get new password from form *****/
@ -680,7 +680,7 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (!Pwd_SlowCheckIfPasswordIsGood (NewPlainPassword,NewEncryptedPassword,-1L)) // New password is good?
{
Error = true;
Lay_ShowAlert (Lay_WARNING,Gbl.Message); // Error message is set in Usr_SlowCheckIfPasswordIsGood
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); // Error message is set in Usr_SlowCheckIfPasswordIsGood
}
return !Error;
@ -814,10 +814,10 @@ void Acc_AfterCreationNewAccount (void)
if (Gbl.Usrs.Me.Logged) // If account has been created without problem, I am logged
{
/***** Show message of success *****/
sprintf (Gbl.Message,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
sprintf (Gbl.Alert.Txt,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
Gbl.Usrs.Me.UsrDat.Nickname,
Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show form with account data *****/
Acc_ShowFormChangeMyAccount ();
@ -1005,9 +1005,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Remove user as administrator of any degree *****/
@ -1017,9 +1017,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Remove user's clipboard in forums *****/
@ -1032,9 +1032,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Acc_RemoveUsrBriefcase (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Briefcase_of_THE_USER_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_Briefcase_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Remove test results made by user in all courses *****/
@ -1048,9 +1048,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Messages_of_THE_USER_X_have_been_deleted,
sprintf (Gbl.Alert.Txt,Txt_Messages_of_THE_USER_X_have_been_deleted,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Remove user from tables of banned users *****/
@ -1095,18 +1095,18 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
PhotoRemoved = Pho_RemovePhoto (UsrDat);
if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Photo_of_THE_USER_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_Photo_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Remove user *****/
Acc_RemoveUsr (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Record_card_of_THE_USER_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_Record_card_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}

View File

@ -1299,9 +1299,9 @@ void Agd_AskRemEvent (void)
/***** Show question and button to remove event *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_event_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X,
AgdEvent.Event);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Gbl.Agenda.AgdCodToEdit = AgdEvent.AgdCod;
@ -1337,8 +1337,8 @@ void Agd_RemoveEvent (void)
DB_QueryDELETE (Query,"can not remove event");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_removed,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
Agd_ShowMyAgenda ();
@ -1369,8 +1369,8 @@ void Agd_HideEvent (void)
DB_QueryUPDATE (Query,"can not hide event");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_hidden,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
Agd_ShowMyAgenda ();
@ -1401,9 +1401,9 @@ void Agd_UnhideEvent (void)
DB_QueryUPDATE (Query,"can not show event");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_visible,
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible,
AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
Agd_ShowMyAgenda ();
@ -1434,8 +1434,8 @@ void Agd_MakeEventPrivate (void)
DB_QueryUPDATE (Query,"can not make event private");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_private,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_private,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
Agd_ShowMyAgenda ();
@ -1466,9 +1466,9 @@ void Agd_MakeEventPublic (void)
DB_QueryUPDATE (Query,"can not make event public");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_visible_to_users_of_your_courses,
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible_to_users_of_your_courses,
AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
Agd_ShowMyAgenda ();
@ -1665,8 +1665,8 @@ void Agd_RecFormEvent (void)
Agd_CreateEvent (&AgdEvent,Txt); // Add new event to database
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_event_X,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{

View File

@ -970,9 +970,9 @@ void Asg_ReqRemAssignment (void)
/***** Show question and button to remove the assignment *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_assignment_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_assignment_X,
Asg.Title);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Gbl.Asgs.AsgCodToEdit = Asg.AsgCod;
@ -1017,9 +1017,9 @@ void Asg_RemoveAssignment (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Assignment_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_removed,
Asg.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show assignments again *****/
Asg_SeeAssignments ();
@ -1049,9 +1049,9 @@ void Asg_HideAssignment (void)
DB_QueryUPDATE (Query,"can not hide assignment");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Assignment_X_is_now_hidden,
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_hidden,
Asg.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show assignments again *****/
Asg_SeeAssignments ();
@ -1081,9 +1081,9 @@ void Asg_ShowAssignment (void)
DB_QueryUPDATE (Query,"can not show assignment");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Assignment_X_is_now_visible,
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_visible,
Asg.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show assignments again *****/
Asg_SeeAssignments ();
@ -1362,9 +1362,9 @@ void Asg_RecFormAssignment (void)
if (Asg_CheckIfSimilarAssignmentExists ("Title",NewAsg.Title,NewAsg.AsgCod))
{
NewAssignmentIsCorrect = false;
sprintf (Gbl.Message,Txt_Already_existed_an_assignment_with_the_title_X,
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_title_X,
NewAsg.Title);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Title is correct
{
@ -1375,15 +1375,15 @@ void Asg_RecFormAssignment (void)
if (Asg_CheckIfSimilarAssignmentExists ("Folder",NewAsg.Folder,NewAsg.AsgCod)) // If folder of assignment was in database...
{
NewAssignmentIsCorrect = false;
sprintf (Gbl.Message,Txt_Already_existed_an_assignment_with_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_folder_X,
NewAsg.Folder);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // Folder name not valid
{
NewAssignmentIsCorrect = false;
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // NewAsg.SendWork == Asg_DO_NOT_SEND_WORK
@ -1416,8 +1416,8 @@ void Asg_RecFormAssignment (void)
Asg_CreateAssignment (&NewAsg,Txt); // Add new assignment to database
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_assignment_X,NewAsg.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Created_new_assignment_X,NewAsg.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{

View File

@ -877,9 +877,9 @@ void Att_AskRemAttEvent (void)
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage);
/***** Ask for confirmation of removing *****/
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_event_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X,
Att.Title);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
Lay_PutRemoveButton (Txt_Remove_event);
Act_FormEnd ();
@ -908,8 +908,8 @@ void Att_GetAndRemAttEvent (void)
Att_RemoveAttEventFromDB (Att.AttCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_removed,Att.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,Att.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/
Att_SeeAttEvents ();
@ -955,9 +955,9 @@ void Att_HideAttEvent (void)
DB_QueryUPDATE (Query,"can not hide attendance event");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_hidden,
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,
Att.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/
Att_SeeAttEvents ();
@ -987,9 +987,9 @@ void Att_ShowAttEvent (void)
DB_QueryUPDATE (Query,"can not show attendance event");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_visible,
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible,
Att.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/
Att_SeeAttEvents ();
@ -1268,9 +1268,9 @@ void Att_RecFormAttEvent (void)
if (Att_CheckIfSimilarAttEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod))
{
ReceivedAttEventIsCorrect = false;
sprintf (Gbl.Message,Txt_Already_existed_an_event_with_the_title_X,
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_event_with_the_title_X,
ReceivedAtt.Title);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // If there is not an attendance event title
@ -1291,8 +1291,8 @@ void Att_RecFormAttEvent (void)
Att_CreateAttEvent (&ReceivedAtt,Txt); // Add new attendance event to database
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_event_X,ReceivedAtt.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,ReceivedAtt.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{
@ -2332,9 +2332,9 @@ void Att_RegisterStudentsInAttEvent (void)
/***** Write final message *****/
sprintf (Format,"%s: %%u<br />%s: %%u",Txt_Presents,Txt_Absents);
sprintf (Gbl.Message,Format,
sprintf (Gbl.Alert.Txt,Format,
NumStdsPresent,NumStdsAbsent);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else // Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs == 0
/***** Show warning indicating no students found *****/

View File

@ -483,9 +483,9 @@ void Ban_RemoveBanner (void)
DB_QueryDELETE (Query,"can not remove a banner");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Banner_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Banner_X_removed,
Ban.ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Ban_EditBanners ();
@ -541,10 +541,10 @@ static void Ban_ShowOrHideBanner (bool Hide)
}
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Hide ? Txt_The_banner_X_is_now_hidden :
sprintf (Gbl.Alert.Txt,Hide ? Txt_The_banner_X_is_now_hidden :
Txt_The_banner_X_is_now_visible,
Ban.ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Ban_EditBanners ();
@ -616,9 +616,9 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewBanName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
CurrentBanName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -628,9 +628,9 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If banner was in database... *****/
if (Ban_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod))
{
sprintf (Gbl.Message,Txt_The_banner_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists,
NewBanName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -638,16 +638,16 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
Ban_UpdateBanNameDB (Ban->BanCod,FieldName,NewBanName);
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_banner_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_has_been_renamed_as_Y,
CurrentBanName,NewBanName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_banner_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_banner_X_has_not_changed,
CurrentBanName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -717,9 +717,9 @@ void Ban_ChangeBannerImg (void)
DB_QueryUPDATE (Query,"can not update the image of a banner");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_image_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_image_is_X,
NewImg);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_image_empty);
@ -762,9 +762,9 @@ void Ban_ChangeBannerWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a banner");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,
NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
@ -908,15 +908,15 @@ void Ban_RecFormNewBanner (void)
/***** If name of banner was in database... *****/
if (Ban_CheckIfBannerNameExists ("ShortName",Ban->ShrtName,-1L))
{
sprintf (Gbl.Message,Txt_The_banner_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists,
Ban->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Ban_CheckIfBannerNameExists ("FullName",Ban->FullName,-1L))
{
sprintf (Gbl.Message,Txt_The_banner_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists,
Ban->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (!Ban->Img[0])
Lay_ShowAlert (Lay_WARNING,Txt_You_must_specify_the_image_of_the_new_banner);
@ -950,9 +950,9 @@ static void Ban_CreateBanner (struct Banner *Ban)
DB_QueryINSERT (Query,"can not create banner");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_banner_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_banner_X,
Ban->ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -1741,9 +1741,9 @@ void Ctr_RemoveCentre (void)
DB_QueryDELETE (Query,"can not remove a centre");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Centre_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Centre_X_removed,
Ctr.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1775,8 +1775,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.ShrtName);
}
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",
@ -1784,8 +1784,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.FullName);
}
else
@ -1799,8 +1799,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Hie_InitHierarchy ();
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName);
}
}
@ -1944,8 +1944,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** Check if new name is empty *****/
if (!NewCtrName[0])
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
CurrentCtrName);
}
else
@ -1956,8 +1956,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** If degree was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,NewCtrName);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,NewCtrName);
}
else
{
@ -1965,8 +1965,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
Ctr_UpdateInsNameDB (Ctr->CtrCod,FieldName,NewCtrName);
/* Write message to show the change made */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_centre_X_has_been_renamed_as_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_renamed_as_Y,
CurrentCtrName,NewCtrName);
/* Change current centre name in order to display it properly */
@ -1976,8 +1976,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
}
else // The same name
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_centre_X_has_not_changed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_centre_X_has_not_changed,
CurrentCtrName);
}
}
@ -2045,8 +2045,8 @@ void Ctr_ChangeCtrWWW (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (Ctr);
@ -2077,8 +2077,8 @@ void Ctr_ChangeCtrWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
@ -2142,9 +2142,9 @@ void Ctr_ChangeCtrStatus (void)
Ctr->Status = Status;
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_status_of_the_centre_X_has_changed,
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_centre_X_has_changed,
Ctr->ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (Ctr);
@ -2162,7 +2162,7 @@ void Ctr_ContEditAfterChgCtr (void)
/***** Write success / warning message *****/
Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
if (Gbl.Alert.Type == Lay_SUCCESS)
/***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (&Gbl.Ctrs.EditingCtr);
@ -2238,7 +2238,7 @@ void Ctr_RequestPhoto (void)
Lay_StartRoundFrame (NULL,Txt_Photo,NULL,NULL);
/***** Write help message *****/
sprintf (Gbl.Message,"%s: %s<br />"
sprintf (Gbl.Alert.Txt,"%s: %s<br />"
"%s: %u&times;%u %s",
Txt_Recommended_aspect_ratio,
Ctr_RECOMMENDED_ASPECT_RATIO,
@ -2246,7 +2246,7 @@ void Ctr_RequestPhoto (void)
Ctr_PHOTO_SAVED_MAX_WIDTH,
Ctr_PHOTO_SAVED_MAX_HEIGHT,
Txt_XxY_pixels_or_higher);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Upload photo *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -2373,10 +2373,10 @@ void Ctr_ReceivePhoto (void)
ReturnCode = WEXITSTATUS(ReturnCode);
if (ReturnCode != 0)
{
sprintf (Gbl.Message,"Image could not be processed successfully.<br />"
sprintf (Gbl.Alert.Txt,"Image could not be processed successfully.<br />"
"Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
/***** Remove temporary file *****/
@ -2706,29 +2706,29 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
/***** If name of centre was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Ctr->ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod))
{
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
Ctr->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Ctr->FullName,-1L,Gbl.CurrentIns.Ins.InsCod))
{
sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
Ctr->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new centre to database
Ctr_CreateCentre (Ctr,Status);
}
else // If there is not a web
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_web_address_of_the_new_centre);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_web_address_of_the_new_centre);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // If there is not a centre name
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -2761,9 +2761,9 @@ static void Ctr_CreateCentre (struct Centre *Ctr,unsigned Status)
Ctr->CtrCod = DB_QueryINSERTandReturnCode (Query,"can not create a new centre");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_centre_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_centre_X,
Ctr->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to centre created *****/
Ctr_PutButtonToGoToCtr (Ctr);

View File

@ -216,14 +216,13 @@
// TODO: Change numbers of notifications in program and database to match order in tabs
// TODO: Sugerencias de Sandra Daniela Tazzioli Barroso realizadas el 2 de mayo de 2017:
// 2. Mejor ayuda sobre cómo pasar de Excel al formato HTML necesario para las calificaciones.
// 3. Puede ser interesante que un administrador pueda cambiar el DNI de un usuario.
// 4. Comprobar que las direcciones de correo de cada uno de los estudiantes aparecen en Bcc: (copia oculta) en cualquier gestor de correo.
// 5. Informar a otros usuarios de que es el cumpleaños de otros usuarios para que los feliciten (habría que añadir una categoría de privacidad nueva para la visibilidad de la fecha de cumpleaños).
// 6. La información sobre nuevas notificaciones debería aparecer también en pantallas pequeñas (móviles). Tal vez podría aparecer también en el icono de notificaciones de la pestaña MENSAJES.
// 8. Estuve confirmando los DNI como indicaste para cargar las notas. En la opcion de la forma lista de los alumnos al ser varios, cada vez que quiero acceder a la ficha de uno de ellos debo bajar al final de la pagina para su vista. Es factible que al señalar algun estudiante y al cliquear con el boton derecho del mouse me permita acceder directamente. De señalar varios se puede insertar una pestaña que diga "siguiente" y no tener que volver a la pestaña estudiantes y hacerlo individualmente a los fines de agilizar la vista. Entiendo que esto se hace en forma periodica pero para tenerlo en cuenta.
// 9. Antonio hay alumnos que han generado el usuario en forma incompleta entre ellos no cargaron el DNI y no asisten a clase para rectificarlo. Hay forma de mi posicion con profesora o adminsitradora del centro ingresar, completar los datos aun conocer su clave?
// TODO: Sugerencias pendientes de Sandra Daniela Tazzioli Barroso realizadas en mayo de 2017:
// - Mejor ayuda sobre cómo pasar de Excel al formato HTML necesario para las calificaciones.
// - Puede ser interesante que un administrador pueda cambiar el DNI de un usuario.
// - Comprobar que las direcciones de correo de cada uno de los estudiantes aparecen en Bcc: (copia oculta) en cualquier gestor de correo.
// - Informar a otros usuarios de que es el cumpleaños de otros usuarios para que los feliciten (habría que añadir una categoría de privacidad nueva para la visibilidad de la fecha de cumpleaños).
// - La información sobre nuevas notificaciones debería aparecer también en pantallas pequeñas (móviles). Tal vez podría aparecer también en el icono de notificaciones de la pestaña MENSAJES.
// - Hay alumnos que han generado el usuario en forma incompleta entre ellos no cargaron el DNI y no asisten a clase para rectificarlo. Hay forma de mi posicion con profesora o adminsitradora del centro ingresar, completar los datos aun conocer su clave?
// TODO: Fix bug: When a centre is associated with a place and it is moved to another institution, what happens with the place?
// TODO: Check what happens with places when a centre is removed
@ -234,13 +233,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.210 (2017-05-10)"
#define Log_PLATFORM_VERSION "SWAD 16.211 (2017-05-10)"
#define CSS_FILE "swad16.209.3.css"
#define JS_FILE "swad16.206.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
Version 16.211: May 10, 2017 Code refactoring related to alerts. (218879 lines)
Version 16.210: May 10, 2017 Changes in layout of records. (218869 lines)
Version 16.209.4: May 10, 2017 Changes in layout of list of guests' records. (218838 lines)
Version 16.209.3: May 10, 2017 Changes in layout of list of teachers' records. (218830 lines)

View File

@ -79,10 +79,10 @@ void Cht_ShowChatRooms (void)
extern const char *Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_;
/***** Help message about software needed to use the whiteboard/chat *****/
sprintf (Gbl.Message,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
sprintf (Gbl.Alert.Txt,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
Cfg_JAVA_URL,Cfg_JAVA_NAME,
Cfg_PLATFORM_SERVER);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** List available chat rooms *****/
Cht_ShowListOfAvailableChatRooms ();

View File

@ -1707,9 +1707,9 @@ void Cty_RemoveCountry (void)
DB_QueryDELETE (Query,"can not remove a country");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Country_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Country_X_removed,
Cty.Name[Gbl.Prefs.Language]);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1750,9 +1750,9 @@ void Cty_RenameCountry (void)
/***** Check if new name is empty *****/
if (!NewCtyName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
Cty->Name[Language]);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -1762,9 +1762,9 @@ void Cty_RenameCountry (void)
/***** If country was in database... *****/
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
{
sprintf (Gbl.Message,Txt_The_country_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists,
NewCtyName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -1773,16 +1773,16 @@ void Cty_RenameCountry (void)
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_country_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_country_X_has_been_renamed_as_Y,
Cty->Name[Language],NewCtyName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_country_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_country_X_has_not_changed,
Cty->Name[Language]);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -1885,8 +1885,8 @@ void Cty_ChangeCtyWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a country");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Str_Copy (Cty->WWW[Language],NewWWW,
@ -2096,9 +2096,9 @@ void Cty_RecFormNewCountry (void)
}
else if (Cty_CheckIfNumericCountryCodeExists (Cty->CtyCod))
{
sprintf (Gbl.Message,Txt_The_numerical_code_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_numerical_code_X_already_exists,
Cty->CtyCod);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
}
else // Numeric code correct
@ -2112,18 +2112,18 @@ void Cty_RecFormNewCountry (void)
if (Cty->Alpha2[i] < 'A' ||
Cty->Alpha2[i] > 'Z')
{
sprintf (Gbl.Message,Txt_The_alphabetical_code_X_is_not_correct,
sprintf (Gbl.Alert.Txt,Txt_The_alphabetical_code_X_is_not_correct,
Cty->Alpha2);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
}
if (CreateCountry)
{
if (Cty_CheckIfAlpha2CountryCodeExists (Cty->Alpha2))
{
sprintf (Gbl.Message,Txt_The_alphabetical_code_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_alphabetical_code_X_already_exists,
Cty->Alpha2);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
}
else // Alphabetic code correct
@ -2141,9 +2141,9 @@ void Cty_RecFormNewCountry (void)
/***** If name of country was in database... *****/
if (Cty_CheckIfCountryNameExists (Lan,Cty->Name[Lan],-1L))
{
sprintf (Gbl.Message,Txt_The_country_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists,
Cty->Name[Lan]);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
break;
}
@ -2232,9 +2232,9 @@ static void Cty_CreateCountry (struct Country *Cty)
DB_QueryINSERT (Query,"can not create country");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_country_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_country_X,
Cty->Name);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -1320,8 +1320,8 @@ void Crs_EditCourses (void)
Deg_GetListDegsOfCurrentCtr ();
/***** Start frame *****/
sprintf (Gbl.Message,Txt_Courses_of_DEGREE_X,Gbl.CurrentDeg.Deg.ShrtName);
Lay_StartRoundFrame (NULL,Gbl.Message,Crs_PutIconToViewCourses,
sprintf (Gbl.Alert.Txt,Txt_Courses_of_DEGREE_X,Gbl.CurrentDeg.Deg.ShrtName);
Lay_StartRoundFrame (NULL,Gbl.Alert.Txt,Crs_PutIconToViewCourses,
Hlp_DEGREE_Courses);
/***** Put a form to create or request a new course *****/
@ -1852,15 +1852,15 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status)
if (Crs_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Crs->ShrtName,-1L,
Crs->DegCod,Crs->Year))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists,
Crs->ShrtName);
}
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Crs->FullName,-1L,
Crs->DegCod,Crs->Year))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists,
Crs->FullName);
}
else // Add new requested course to database
@ -1868,14 +1868,14 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status)
}
else // If there is not a course name
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_course);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_course);
}
}
else // Year not valid
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_year_X_is_not_allowed,Crs->Year);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,Crs->Year);
}
}
@ -1926,8 +1926,8 @@ static void Crs_CreateCourse (struct Course *Crs,unsigned Status)
Crs->CrsCod = DB_QueryINSERTandReturnCode (Query,"can not create a new course");
/***** Create success message *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_Created_new_course_X,Crs->FullName);
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_course_X,Crs->FullName);
}
/*****************************************************************************/
@ -1958,9 +1958,9 @@ void Crs_RemoveCourse (void)
Crs_RemoveCourseCompletely (Crs.CrsCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Course_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Course_X_removed,
Crs.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else
@ -2268,11 +2268,11 @@ void Crs_ChangeInsCrsCodInConfig (void)
{
Crs_UpdateInstitutionalCrsCod (&Gbl.CurrentCrs.Crs,NewInstitutionalCrsCod);
sprintf (Gbl.Message,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Gbl.CurrentCrs.Crs.ShrtName,NewInstitutionalCrsCod);
}
else // The same institutional code
sprintf (Gbl.Message,Txt_The_institutional_code_of_the_course_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_not_changed,
Gbl.CurrentCrs.Crs.ShrtName);
}
@ -2306,21 +2306,21 @@ void Crs_ChangeInsCrsCod (void)
if (strcmp (NewInstitutionalCrsCod,Crs->InstitutionalCrsCod))
{
Crs_UpdateInstitutionalCrsCod (Crs,NewInstitutionalCrsCod);
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Crs->ShrtName,NewInstitutionalCrsCod);
}
else // The same institutional code
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_institutional_code_of_the_course_X_has_not_changed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_not_changed,
Crs->ShrtName);
}
}
else
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_You_dont_have_permission_to_edit_this_course);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_You_dont_have_permission_to_edit_this_course);
}
}
@ -2348,15 +2348,15 @@ void Crs_ChangeCrsDegInConfig (void)
if (Crs_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.CurrentCrs.Crs.ShrtName,-1L,
NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,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,
NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,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
@ -2370,8 +2370,8 @@ void Crs_ChangeCrsDegInConfig (void)
Hie_InitHierarchy ();
/***** Create message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_course_X_has_been_moved_to_the_degree_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_has_been_moved_to_the_degree_Y,
Gbl.CurrentCrs.Crs.FullName,
Gbl.CurrentDeg.Deg.FullName);
}
@ -2428,15 +2428,15 @@ void Crs_ChangeCrsYearInConfig (void)
if (Crs_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.CurrentCrs.Crs.ShrtName,-1L,
Gbl.CurrentCrs.Crs.DegCod,NewYear))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,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,
Gbl.CurrentCrs.Crs.DegCod,NewYear))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
Gbl.CurrentCrs.Crs.FullName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else // Update year in database
@ -2445,15 +2445,15 @@ void Crs_ChangeCrsYearInConfig (void)
Crs_UpdateCrsYear (&Gbl.CurrentCrs.Crs,NewYear);
/***** Create message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_year_of_the_course_X_has_changed,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_year_of_the_course_X_has_changed,
Gbl.CurrentCrs.Crs.ShrtName);
}
}
else // Year not valid
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_year_X_is_not_allowed,NewYear);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,NewYear);
}
}
@ -2496,15 +2496,15 @@ void Crs_ChangeCrsYear (void)
if (Crs_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Crs->ShrtName,-1L,
Crs->DegCod,NewYear))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
Crs->ShrtName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Crs->FullName,-1L,
Crs->DegCod,NewYear))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
Crs->FullName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else // Update year in database
@ -2513,21 +2513,21 @@ void Crs_ChangeCrsYear (void)
Crs_UpdateCrsYear (Crs,NewYear);
/***** Create message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_year_of_the_course_X_has_changed,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_year_of_the_course_X_has_changed,
Crs->ShrtName);
}
}
else // Year not valid
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_year_X_is_not_allowed,NewYear);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,NewYear);
}
}
else
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_You_dont_have_permission_to_edit_this_course);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_You_dont_have_permission_to_edit_this_course);
}
}
@ -2641,8 +2641,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
/***** Check if new name is empty *****/
if (!NewCrsName[0])
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_course_X_empty,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_course_X_empty,
CurrentCrsName);
}
else
@ -2654,8 +2654,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
if (Crs_CheckIfCrsNameExistsInYearOfDeg (ParamName,NewCrsName,Crs->CrsCod,
Crs->DegCod,Crs->Year))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_course_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists,
NewCrsName);
}
else
@ -2664,8 +2664,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
Crs_UpdateCrsNameDB (Crs->CrsCod,FieldName,NewCrsName);
/* Create message to show the change made */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_name_of_the_course_X_has_changed_to_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_course_X_has_changed_to_Y,
CurrentCrsName,NewCrsName);
/* Change current course name in order to display it properly */
@ -2675,16 +2675,16 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
}
else // The same name
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_course_X_has_not_changed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_course_X_has_not_changed,
CurrentCrsName);
}
}
}
else
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_You_dont_have_permission_to_edit_this_course);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_You_dont_have_permission_to_edit_this_course);
}
}
@ -2759,7 +2759,7 @@ void Crs_ChangeCrsStatus (void)
Crs->Status = Status;
/***** Create message to show the change made *****/
sprintf (Gbl.Message,Txt_The_status_of_the_course_X_has_changed,
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_course_X_has_changed,
Crs->ShrtName);
}
@ -2774,7 +2774,7 @@ void Crs_ContEditAfterChgCrs (void)
/***** Write warning / success message *****/
Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
if (Gbl.Alert.Type == Lay_SUCCESS)
{
fprintf (Gbl.F.Out,"<div class=\"BUTTONS_AFTER_ALERT\">");
@ -3372,11 +3372,11 @@ void Crs_RemoveOldCrss (void)
SecondsWithoutAccess);
if ((NumCrss = DB_QuerySELECT (Query,&mysql_res,"can not get old users")))
{
sprintf (Gbl.Message,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
sprintf (Gbl.Alert.Txt,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
NumCrss,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Remove courses *****/
for (NumCrs = 0;
@ -3394,7 +3394,7 @@ void Crs_RemoveOldCrss (void)
}
/***** Write end message *****/
sprintf (Gbl.Message,Txt_X_courses_have_been_eliminated,
sprintf (Gbl.Alert.Txt,Txt_X_courses_have_been_eliminated,
NumCrssRemoved);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -1136,9 +1136,9 @@ static void Deg_CreateDegree (struct Degree *Deg,unsigned Status)
Deg->DegCod = DB_QueryINSERTandReturnCode (Query,"can not create a new degree");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_degree_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_degree_X,
Deg->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to degree created *****/
Deg_PutButtonToGoToDeg (Deg);
@ -1549,29 +1549,29 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status)
/***** If name of degree was in database... *****/
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Deg->ShrtName,-1L,Deg->CtrCod))
{
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
Deg->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Deg->FullName,-1L,Deg->CtrCod))
{
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
Deg->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new degree to database
Deg_CreateDegree (Deg,Status);
}
else // If there is not a degree logo or web
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_web_address_of_the_new_degree);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_web_address_of_the_new_degree);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // If there is not a degree name
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_degree);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_degree);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1603,9 +1603,9 @@ void Deg_RemoveDegree (void)
Deg_RemoveDegreeCompletely (Deg.DegCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Degree_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Degree_X_removed,
Deg.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1960,8 +1960,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
/***** Check if new name is empty *****/
if (!NewDegName[0])
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_degree_X_empty,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_degree_X_empty,
CurrentDegName);
}
else
@ -1972,8 +1972,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
/***** If degree was in database... *****/
if (Deg_CheckIfDegNameExistsInCtr (ParamName,NewDegName,Deg->DegCod,Deg->CtrCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,NewDegName);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,NewDegName);
}
else
{
@ -1981,8 +1981,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
Deg_UpdateDegNameDB (Deg->DegCod,FieldName,NewDegName);
/* Write message to show the change made */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_name_of_the_degree_X_has_changed_to_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_degree_X_has_changed_to_Y,
CurrentDegName,NewDegName);
/* Change current degree name in order to display it properly */
@ -1992,8 +1992,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
}
else // The same name
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_degree_X_has_not_changed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_degree_X_has_not_changed,
CurrentDegName);
}
}
@ -2050,14 +2050,14 @@ void Deg_ChangeDegCtrInConfig (void)
/***** Check if it already exists a degree with the same name in the new centre *****/
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.CurrentDeg.Deg.ShrtName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,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))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_degree_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
Gbl.CurrentDeg.Deg.FullName);
}
else
@ -2071,8 +2071,8 @@ void Deg_ChangeDegCtrInConfig (void)
Hie_InitHierarchy ();
/***** Create message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_degree_X_has_been_moved_to_the_centre_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_has_been_moved_to_the_centre_Y,
Gbl.CurrentDeg.Deg.FullName,
Gbl.CurrentCtr.Ctr.FullName);
}
@ -2138,8 +2138,8 @@ void Deg_ChangeDegWWW (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to degree changed *****/
Deg_PutButtonToGoToDeg (Deg);
@ -2170,8 +2170,8 @@ void Deg_ChangeDegWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
@ -2234,9 +2234,9 @@ void Deg_ChangeDegStatus (void)
Deg->Status = Status;
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_status_of_the_degree_X_has_changed,
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_degree_X_has_changed,
Deg->ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to degree changed *****/
Deg_PutButtonToGoToDeg (Deg);
@ -2254,7 +2254,7 @@ void Deg_ContEditAfterChgDeg (void)
/***** Write success / warning message *****/
Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
if (Gbl.Alert.Type == Lay_SUCCESS)
/***** Put button to go to degree changed *****/
Deg_PutButtonToGoToDeg (&Gbl.Degs.EditingDeg);

View File

@ -549,9 +549,9 @@ static void DT_CreateDegreeType (struct DegreeType *DegTyp)
DB_QueryINSERT (Query,"can not create a new type of degree");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_type_of_degree_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_type_of_degree_X,
DegTyp->DegTypName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -718,17 +718,17 @@ void DT_RecFormNewDegreeType (void)
/***** If name of degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (DegTyp->DegTypName,-1L))
{
sprintf (Gbl.Message,Txt_The_type_of_degree_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_already_exists,
DegTyp->DegTypName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new degree type to database
DT_CreateDegreeType (DegTyp);
}
else // If there is not a degree type name
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_type_of_degree);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_name_of_the_new_type_of_degree);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -762,9 +762,9 @@ void DT_RemoveDegreeType (void)
DT_RemoveDegreeTypeCompletely (DegTyp.DegTypCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Type_of_degree_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Type_of_degree_X_removed,
DegTyp.DegTypName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -932,9 +932,9 @@ void DT_RenameDegreeType (void)
/***** Check if new name is empty *****/
if (!NewNameDegTyp[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
DegTyp->DegTypName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -944,9 +944,9 @@ void DT_RenameDegreeType (void)
/***** If degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (NewNameDegTyp,DegTyp->DegTypCod))
{
sprintf (Gbl.Message,Txt_The_type_of_degree_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_already_exists,
NewNameDegTyp);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -957,16 +957,16 @@ void DT_RenameDegreeType (void)
DB_QueryUPDATE (Query,"can not update the type of a degree");
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_type_of_degree_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_has_been_renamed_as_Y,
DegTyp->DegTypName,NewNameDegTyp);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_type_of_degree_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_type_of_degree_X_has_not_changed,
NewNameDegTyp);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -1020,9 +1020,9 @@ void DT_ChangeDegreeType (void)
DB_QueryUPDATE (Query,"can not update the type of a degree");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_type_of_degree_of_the_degree_X_has_changed,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_of_the_degree_X_has_changed,
Deg->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to degree changed *****/
Deg_PutButtonToGoToDeg (Deg);

View File

@ -637,8 +637,8 @@ void Dpt_RemoveDepartment (void)
DB_QueryDELETE (Query,"can not remove a department");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Department_X_removed,Dpt.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Department_X_removed,Dpt.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -743,9 +743,9 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewDptName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_department_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_department_X_empty,
CurrentDptName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -755,9 +755,9 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If degree was in database... *****/
if (Dpt_CheckIfDepartmentNameExists (ParamName,NewDptName,Dpt->DptCod))
{
sprintf (Gbl.Message,Txt_The_department_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists,
NewDptName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -765,16 +765,16 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
Dpt_UpdateDegNameDB (Dpt->DptCod,FieldName,NewDptName);
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_department_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_department_X_has_been_renamed_as_Y,
CurrentDptName,NewDptName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_department_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_department_X_has_not_changed,
CurrentDptName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -844,14 +844,14 @@ void Dpt_ChangeDptWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a department");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,
NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{
sprintf (Gbl.Message,"%s",Txt_You_can_not_leave_the_web_address_empty);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_can_not_leave_the_web_address_empty);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1036,29 +1036,29 @@ void Dpt_RecFormNewDpt (void)
/***** If name of department was in database... *****/
if (Dpt_CheckIfDepartmentNameExists ("ShortName",Dpt->ShrtName,-1L))
{
sprintf (Gbl.Message,Txt_The_department_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists,
Dpt->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Dpt_CheckIfDepartmentNameExists ("FullName",Dpt->FullName,-1L))
{
sprintf (Gbl.Message,Txt_The_department_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists,
Dpt->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new department to database
Dpt_CreateDepartment (Dpt);
}
else // If there is not a web
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_web_address_of_the_new_department);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_web_address_of_the_new_department);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // If there is not a department name
{
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_department);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_department);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1086,9 +1086,9 @@ static void Dpt_CreateDepartment (struct Department *Dpt)
DB_QueryINSERT (Query,"can not create a new department");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_department_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_department_X,
Dpt->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -359,10 +359,10 @@ void Enr_ReqAcceptRegisterInCrs (void)
Hlp_USERS_SignUp_confirm_enrolment);
/***** Show message *****/
sprintf (Gbl.Message,Txt_A_teacher_or_administrator_has_enroled_you_as_X_into_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_A_teacher_or_administrator_has_enroled_you_as_X_into_the_course_Y,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Send button to accept register in the current course *****/
Act_FormStart (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActAccEnrStd :
@ -639,9 +639,9 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
else
{
/* Write help message */
sprintf (Gbl.Message,Txt_No_groups_have_been_created_in_the_course_X_Therefore_,
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X_Therefore_,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -761,11 +761,11 @@ void Enr_RemoveOldUsrs (void)
(unsigned long) SecondsWithoutAccess);
if ((NumUsrs = DB_QuerySELECT (Query,&mysql_res,"can not get old users")))
{
sprintf (Gbl.Message,Txt_Eliminating_X_users_who_were_not_enroled_in_any_course_and_with_more_than_Y_months_without_access_to_Z,
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,
NumUsrs,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
@ -795,9 +795,9 @@ void Enr_RemoveOldUsrs (void)
}
/***** Write end message *****/
sprintf (Gbl.Message,Txt_X_users_have_been_eliminated,
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_eliminated,
NumUsrsEliminated);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -895,7 +895,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER)
{
sprintf (Gbl.Message,UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
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),
@ -914,7 +914,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -928,7 +928,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsDegAdmin &&
Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM)
{
sprintf (Gbl.Message,Txt_Register_USER_as_an_administrator_of_the_degree_X,
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
@ -944,7 +944,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -953,7 +953,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsCtrAdmin &&
Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM)
{
sprintf (Gbl.Message,Txt_Register_USER_as_an_administrator_of_the_centre_X,
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
@ -969,7 +969,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -979,7 +979,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsInsAdmin &&
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
{
sprintf (Gbl.Message,Txt_Register_USER_as_an_administrator_of_the_institution_X,
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
@ -995,7 +995,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -1026,7 +1026,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
/***** Remove user from the course *****/
if (UsrBelongsToCrs)
{
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_from_the_course_X :
Txt_Remove_USER_from_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
@ -1044,7 +1044,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -1058,7 +1058,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsDegAdmin &&
(ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM))
{
sprintf (Gbl.Message,
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);
@ -1076,7 +1076,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -1085,7 +1085,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsCtrAdmin &&
(ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM))
{
sprintf (Gbl.Message,
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);
@ -1103,7 +1103,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -1113,7 +1113,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsInsAdmin &&
(ItsMe || Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM))
{
sprintf (Gbl.Message,
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);
@ -1131,7 +1131,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
"%s"
"</label>"
"</li>",
Gbl.Message);
Gbl.Alert.Txt);
NumOptionsShown++;
}
@ -1617,9 +1617,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Lay_ShowAlert (Lay_SUCCESS,Txt_One_user_has_been_eliminated);
break;
default:
sprintf (Gbl.Message,Txt_X_users_have_been_eliminated,
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_eliminated,
NumUsrsEliminated);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
break;
}
else // Only remove from course / groups
@ -1632,9 +1632,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Lay_ShowAlert (Lay_SUCCESS,Txt_One_user_has_been_removed);
break;
default:
sprintf (Gbl.Message,Txt_X_users_have_been_removed,
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_removed,
NumUsrsRemoved);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
break;
}
}
@ -1648,9 +1648,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Lay_ShowAlert (Lay_SUCCESS,Txt_One_user_has_been_enroled);
break;
default:
sprintf (Gbl.Message,Txt_X_users_have_been_enroled_including_possible_repetitions,
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_enroled_including_possible_repetitions,
NumUsrsRegistered);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
break;
}
@ -1749,9 +1749,9 @@ void Enr_AskRemAllStdsThisCrs (void)
{
/***** Show question and button to remove students *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
NumStds,Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show form to request confirmation */
Act_FormStart (ActRemAllStdCrs);
@ -1784,9 +1784,9 @@ void Enr_RemAllStdsThisCrs (void)
{
if ((NumStdsInCrs = Enr_RemAllStdsInCrs (&Gbl.CurrentCrs.Crs)))
{
sprintf (Gbl.Message,Txt_The_X_students_who_belonged_to_the_course_Y_have_been_removed_from_it,
sprintf (Gbl.Alert.Txt,Txt_The_X_students_who_belonged_to_the_course_Y_have_been_removed_from_it,
NumStdsInCrs,Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
/***** Show warning indicating no students found *****/
@ -1837,10 +1837,10 @@ void Enr_ReqSignUpInCrs (void)
/***** Check if I already belong to course *****/
if (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB >= Rol_STUDENT)
{
sprintf (Gbl.Message,Txt_You_were_already_enroled_as_X_in_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_You_were_already_enroled_as_X_in_the_course_Y,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Gbl.Usrs.Me.LoggedRole == Rol__GUEST_ ||
Gbl.Usrs.Me.LoggedRole == Rol_VISITOR)
@ -1869,10 +1869,10 @@ void Enr_SignUpInCrs (void)
/***** Check if I already belong to course *****/
if (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB >= Rol_STUDENT)
{
sprintf (Gbl.Message,Txt_You_were_already_enroled_as_X_in_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_You_were_already_enroled_as_X_in_the_course_Y,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -1926,10 +1926,10 @@ void Enr_SignUpInCrs (void)
}
/***** Show confirmation message *****/
sprintf (Gbl.Message,Txt_Your_request_for_enrolment_as_X_in_the_course_Y_has_been_accepted_for_processing,
sprintf (Gbl.Alert.Txt,Txt_Your_request_for_enrolment_as_X_in_the_course_Y_has_been_accepted_for_processing,
Txt_ROLES_SINGUL_abc[RoleFromForm][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Notify teachers or admins by email about the new enrolment request *****/
// If this course has teachers ==> send notification to teachers
@ -2025,9 +2025,9 @@ void Enr_AskIfRejectSignUp (void)
false))
{
/* User already belongs to this course */
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
/* Remove inscription request because it has not sense */
@ -2041,11 +2041,11 @@ void Enr_AskIfRejectSignUp (void)
{
/***** Show question and button to reject user's enrolment request *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_reject_the_enrolment_request_,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reject_the_enrolment_request_,
Gbl.Usrs.Other.UsrDat.FullName,
Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Other.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -2083,9 +2083,9 @@ void Enr_RejectSignUp (void)
false))
{
/* User already belongs to this course */
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
}
@ -2093,9 +2093,9 @@ void Enr_RejectSignUp (void)
Enr_RemoveEnrolmentRequest (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Other.UsrDat.UsrCod);
/* Confirmation message */
sprintf (Gbl.Message,Txt_Enrolment_of_X_rejected,
sprintf (Gbl.Alert.Txt,Txt_Enrolment_of_X_rejected,
Gbl.Usrs.Other.UsrDat.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
@ -3077,9 +3077,9 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
/***** Warning if more than one user found *****/
if (ListUsrCods->NumUsrs > 1)
{
sprintf (Gbl.Message,Txt_There_are_X_users_with_the_ID_Y,
sprintf (Gbl.Alert.Txt,Txt_There_are_X_users_with_the_ID_Y,
ListUsrCods->NumUsrs,Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** For each user found... *****/
@ -3102,29 +3102,29 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
Gbl.CurrentCrs.Crs.CrsCod,
true);
if (Gbl.Usrs.Other.UsrDat.Accepted)
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
sprintf (Gbl.Alert.Txt,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
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_in_the_course_Y_but_has_not_yet_accepted_the_enrolment,
sprintf (Gbl.Alert.Txt,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);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr ();
}
else // User does not belong to the current course
{
sprintf (Gbl.Message,Txt_THE_USER_X_already_exists_in_Y_but_is_not_yet_enroled_in_the_course_Z,
sprintf (Gbl.Alert.Txt,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);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr ();
}
}
else // No course selected
{
sprintf (Gbl.Message,Txt_THE_USER_X_already_exists_in_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_already_exists_in_Y,
Gbl.Usrs.Other.UsrDat.FullName,Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr ();
}
@ -3145,17 +3145,17 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
if (NewUsrIDValid)
{
/***** Show form to enter the data of a new user *****/
sprintf (Gbl.Message,Txt_The_user_is_new_not_yet_in_X,
sprintf (Gbl.Alert.Txt,Txt_The_user_is_new_not_yet_in_X,
Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
Rec_ShowFormOtherNewSharedRecord (&Gbl.Usrs.Other.UsrDat,Role);
}
else // User's ID is not valid
{
/* Write message and request a new user's ID */
sprintf (Gbl.Message,Txt_If_this_is_a_new_user_in_X_you_should_indicate_her_his_ID,
sprintf (Gbl.Alert.Txt,Txt_If_this_is_a_new_user_in_X_you_should_indicate_her_his_ID,
Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
Enr_ReqRegRemUsr (Role);
}
}
@ -3262,7 +3262,7 @@ static void Enr_RegisterAdmin (struct UsrData *UsrDat,Sco_Scope_t Scope,long Cod
/***** Check if user was and administrator of current institution/centre/degree *****/
if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,Scope,Cod))
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_an_administrator_of_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_an_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
else // User was not administrator of current institution/centre/degree
{
@ -3274,10 +3274,10 @@ static void Enr_RegisterAdmin (struct UsrData *UsrDat,Sco_Scope_t Scope,long Cod
UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod);
DB_QueryREPLACE (Query,"can not create administrator");
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enroled_as_administrator_of_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_as_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
}
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3446,9 +3446,9 @@ static void Enr_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr,Sco_Scope_t
}
else // The other user is not an administrator of current institution
{
sprintf (Gbl.Message,Txt_THE_USER_X_is_not_an_administrator_of_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_an_administrator_of_Y,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else
@ -3494,18 +3494,18 @@ 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
{
sprintf (Gbl.Message,Txt_THE_USER_X_is_already_an_administrator_of_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_an_administrator_of_Y,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
}
else
{
/***** Show question and button to register user as administrator *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
InsCtrDegName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -3543,9 +3543,9 @@ void Enr_AcceptRegisterMeInCrs (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Confirmation message *****/
sprintf (Gbl.Message,Txt_You_have_confirmed_your_enrolment_in_the_course_X,
sprintf (Gbl.Alert.Txt,Txt_You_have_confirmed_your_enrolment_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3565,7 +3565,7 @@ void Enr_CreateNewUsr1 (void)
ID_GetParamOtherUsrIDPlain (); // User's ID was already modified and passed as a hidden parameter
/***** Initialize alert type and message *****/
Gbl.AlertType = Lay_NONE; // Do not show alert
Gbl.Alert.Type = Lay_NONE; // Do not show alert
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID)) // User's ID valid
{
@ -3596,8 +3596,8 @@ void Enr_CreateNewUsr1 (void)
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole);
/* Success message */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]);
@ -3610,8 +3610,8 @@ void Enr_CreateNewUsr1 (void)
Enr_SET_ACCEPTED_TO_FALSE);
/* Success message */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
}
}
@ -3625,15 +3625,15 @@ void Enr_CreateNewUsr1 (void)
else // User's ID not valid
{
/***** Error message *****/
Gbl.AlertType = Lay_ERROR;
sprintf (Gbl.Message,Txt_The_ID_X_is_not_valid,
Gbl.Alert.Type = Lay_ERROR;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,
Gbl.Usrs.Other.UsrDat.IDs.List[0].ID);
}
}
void Enr_CreateNewUsr2 (void)
{
if (Gbl.AlertType == Lay_ERROR) // User's ID not valid
if (Gbl.Alert.Type == Lay_ERROR) // User's ID not valid
Lay_ShowPendingAlert ();
else // User's ID valid
{
@ -3666,7 +3666,7 @@ void Enr_ModifyUsr1 (void)
Rol_Role_t NewRole;
/***** Initialize alert type and message *****/
Gbl.AlertType = Lay_NONE; // Do not show alert
Gbl.Alert.Type = Lay_NONE; // Do not show alert
/***** Get user from form *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
@ -3708,8 +3708,8 @@ void Enr_ModifyUsr1 (void)
Enr_ModifyRoleInCurrentCrs (&Gbl.Usrs.Other.UsrDat,NewRole);
/* Set success message */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]);
@ -3722,8 +3722,8 @@ void Enr_ModifyUsr1 (void)
Enr_SET_ACCEPTED_TO_FALSE);
/* Set success message */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
}
@ -3735,58 +3735,58 @@ void Enr_ModifyUsr1 (void)
}
}
else
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REGISTER_ONE_DEGREE_ADMIN:
if (Gbl.Usrs.Me.LoggedRole < Rol_CTR_ADM)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REGISTER_ONE_CENTRE_ADMIN:
if (Gbl.Usrs.Me.LoggedRole < Rol_INS_ADM)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REGISTER_ONE_INSTITUTION_ADMIN:
if (Gbl.Usrs.Me.LoggedRole != Rol_SYS_ADM)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE:
if (ItsMe || Gbl.Usrs.Me.LoggedRole < Rol_TEACHER)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REMOVE_ONE_USR_FROM_CRS:
if (!ItsMe && Gbl.Usrs.Me.LoggedRole < Rol_TEACHER)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REMOVE_ONE_DEGREE_ADMIN:
if (!ItsMe && Gbl.Usrs.Me.LoggedRole < Rol_CTR_ADM)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REMOVE_ONE_CENTRE_ADMIN:
if (!ItsMe && Gbl.Usrs.Me.LoggedRole < Rol_INS_ADM)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_REMOVE_ONE_INSTITUTION_ADMIN:
if (!ItsMe && Gbl.Usrs.Me.LoggedRole != Rol_SYS_ADM)
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
case Enr_ELIMINATE_ONE_USR_FROM_PLATFORM:
if (!Acc_CheckIfICanEliminateAccount (Gbl.Usrs.Other.UsrDat.UsrCod))
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
default:
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
break;
}
}
else
Gbl.AlertType = Lay_WARNING;
Gbl.Alert.Type = Lay_WARNING;
}
void Enr_ModifyUsr2 (void)
{
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
if (Gbl.AlertType == Lay_WARNING)
if (Gbl.Alert.Type == Lay_WARNING)
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
else // No error
switch (Gbl.Usrs.RegRemAction)
@ -3878,11 +3878,11 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat,bool ItsMe)
{
/***** Show question and button to remove user as administrator *****/
/* Start alert */
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (UsrDat);
@ -3952,9 +3952,9 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,struct Course *
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_the_course_Y,
UsrDat->FullName,Crs->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // User does not belong to course
@ -3987,11 +3987,11 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,const char *InsCtrDegN
{
/***** Show question and button to remove user as administrator *****/
/* Start alert */
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
InsCtrDegName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show user's record */
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -4027,14 +4027,14 @@ static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope,
UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod);
DB_QueryDELETE (Query,"can not remove an administrator");
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator_of_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else // User is not an administrator of the current institution/centre/degree
{
sprintf (Gbl.Message,Txt_THE_USER_X_is_not_an_administrator_of_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_an_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
}

View File

@ -658,9 +658,9 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx
/***** The result of the query may be empty *****/
if (!NumExaAnns)
{
sprintf (Gbl.Message,Txt_No_announcements_of_exams_of_X,
sprintf (Gbl.Alert.Txt,Txt_No_announcements_of_exams_of_X,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** List the existing exam announcements *****/

View File

@ -110,7 +110,7 @@ void Fil_CloseAndRemoveFileForHTMLOutput (void)
/*****************************************************************************/
/********** Open temporary file and write on it reading from stdin ***********/
/*****************************************************************************/
// On error, Gbl.Message will contain feedback
// On error, Gbl.Alert.Txt will contain feedback
bool Fil_ReadStdinIntoTmpFile (void)
{
@ -141,10 +141,10 @@ bool Fil_ReadStdinIntoTmpFile (void)
{
Fil_EndOfReadingStdin (); // If stdin were not fully read, there will be problems with buffers
if (FileIsTooBig)
sprintf (Gbl.Message,Txt_UPLOAD_FILE_File_too_large_maximum_X_MiB_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_File_too_large_maximum_X_MiB_NO_HTML,
(unsigned long) (Fil_MAX_FILE_SIZE / (1024ULL * 1024ULL)));
else
sprintf (Gbl.Message,Txt_UPLOAD_FILE_Upload_time_too_long_maximum_X_minutes_NO_HTML,
sprintf (Gbl.Alert.Txt,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 */
@ -158,7 +158,7 @@ bool Fil_ReadStdinIntoTmpFile (void)
/* Status code and message */
fprintf (stdout,"Status: 501 Not Implemented\r\n\r\n"
"%s\n",
Gbl.Message);
Gbl.Alert.Txt);
return false;
}
rewind (Gbl.F.Tmp);
@ -341,8 +341,8 @@ void Fil_CreateUpdateFile (const char CurrentName[PATH_MAX + 1],
/* Open the new file */
if ((*NewFile = fopen (NewName,"wb")) == NULL)
{
sprintf (Gbl.Message,"Can not create file <strong>%s</strong>.",NewName);
Lay_ShowErrorAndExit (Gbl.Message);
sprintf (Gbl.Alert.Txt,"Can not create file <strong>%s</strong>.",NewName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}
@ -358,15 +358,15 @@ void Fil_CloseUpdateFile (const char *CurrentName,const char *OldName,const char
/* Rename the old file and the new file */
if (rename (CurrentName,OldName)) // mv CurrentName OldName Ej: mv file.html file.old
{
sprintf (Gbl.Message,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
sprintf (Gbl.Alert.Txt,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
CurrentName,OldName);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
if (rename (NewName,CurrentName)) // mv NewName CurrentName Ej: mv file.new file.html
{
sprintf (Gbl.Message,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
sprintf (Gbl.Alert.Txt,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
NewName,CurrentName);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}
@ -386,11 +386,11 @@ bool Fil_RenameFileOrDir (const char *PathOld,const char *PathNew)
{
case ENOTEMPTY:
case EEXIST:
sprintf (Gbl.Message,Txt_There_is_already_a_non_empty_folder_named_X,
sprintf (Gbl.Alert.Txt,Txt_There_is_already_a_non_empty_folder_named_X,
PathNew);
break;
case ENOTDIR:
sprintf (Gbl.Message,Txt_There_is_already_a_file_named_X,
sprintf (Gbl.Alert.Txt,Txt_There_is_already_a_file_named_X,
PathNew);
break;
case EACCES:
@ -426,8 +426,8 @@ void Fil_CreateDirIfNotExists (const char *Path)
if (!Fil_CheckIfPathExists (Path))
if (mkdir (Path,(mode_t) 0xFFF) != 0)
{
sprintf (Gbl.Message,"Can not create folder <strong>%s</strong>.",Path);
Lay_ShowErrorAndExit (Gbl.Message);
sprintf (Gbl.Alert.Txt,"Can not create folder <strong>%s</strong>.",Path);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}
@ -485,8 +485,8 @@ void Fil_RemoveTree (const char *Path)
Error = true;
if (Error)
{
sprintf (Gbl.Message,"Can not remove folder %s.",Path);
Lay_ShowErrorAndExit (Gbl.Message);
sprintf (Gbl.Alert.Txt,"Can not remove folder %s.",Path);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}
}

View File

@ -2878,13 +2878,13 @@ bool Brw_UpdateFoldersAssigmentsIfExistForAllUsrs (const char *OldFolderName,con
}
/***** Summary message *****/
sprintf (Gbl.Message,"%s: %u<br />"
sprintf (Gbl.Alert.Txt,"%s: %u<br />"
"%s: %u<br />"
"%s: %u.",
Txt_Users,NumUsrs,
Txt_Folders_renamed,NumUsrsSuccess,
Txt_Folders_not_renamed,NumUsrsError);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else
/***** Warning message *****/
@ -3474,10 +3474,10 @@ void Brw_ShowAgainFileBrowserOrWorks (void)
}
/***** Legal notice *****/
sprintf (Gbl.Message,Txt_Disclaimer_the_files_hosted_here_,
sprintf (Gbl.Alert.Txt,Txt_Disclaimer_the_files_hosted_here_,
Cfg_PLATFORM_SHORT_NAME,
Cfg_PLATFORM_RESPONSIBLE_EMAIL);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -6188,9 +6188,9 @@ void Brw_AskRemFileFromTree (void)
Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.FileType,Gbl.FileBrowser.Level,
Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName,FileNameToShow);
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_FILE_OR_LINK_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_FILE_OR_LINK_X,
FileNameToShow);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Lay_ShowAlertAndButton2 (Brw_ActRemoveFile[Gbl.FileBrowser.Type],NULL,
@ -6257,8 +6257,8 @@ void Brw_RemFileFromTree (void)
Gbl.Usrs.Other.UsrDat.UsrCod);
/* Message of confirmation of removing */
sprintf (Gbl.Message,Txt_FILE_X_removed,FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_FILE_X_removed,FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else // File / link not found
Lay_ShowErrorAndExit ("File / link not found.");
@ -6298,7 +6298,7 @@ void Brw_RemFolderFromTree (void)
if (errno == ENOTEMPTY) // The directory is not empty
{
Brw_AskConfirmRemoveFolderNotEmpty ();
Gbl.Message[0] = '\0';
Gbl.Alert.Txt[0] = '\0';
}
else // The directory is empty
Lay_ShowErrorAndExit ("Can not remove folder.");
@ -6311,9 +6311,9 @@ void Brw_RemFolderFromTree (void)
Gbl.Usrs.Other.UsrDat.UsrCod);
/* Message of confirmation of successfull removing */
sprintf (Gbl.Message,Txt_Folder_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Folder_X_removed,
Gbl.FileBrowser.FilFolLnkName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else // Folder not found
Lay_ShowErrorAndExit ("Folder not found.");
@ -6336,9 +6336,9 @@ static void Brw_AskConfirmRemoveFolderNotEmpty (void)
/***** Show question and button to remove not empty folder *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_folder_X,
Gbl.FileBrowser.FilFolLnkName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Lay_ShowAlertAndButton2 (Brw_ActRemoveFolderNotEmpty[Gbl.FileBrowser.Type],NULL,
@ -6389,9 +6389,9 @@ void Brw_RemSubtreeInFileBrowser (void)
Brw_RemoveAffectedExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree);
/***** Write message of confirmation *****/
sprintf (Gbl.Message,Txt_Folder_X_and_all_its_contents_removed,
sprintf (Gbl.Alert.Txt,Txt_Folder_X_and_all_its_contents_removed,
Gbl.FileBrowser.FilFolLnkName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show again file browser *****/
@ -6662,18 +6662,18 @@ static void Brw_WriteCurrentClipboard (void)
Gbl.FileBrowser.Clipboard.FileType,
Gbl.FileBrowser.Clipboard.FileName,FileNameToShow);
sprintf (Gbl.Message,"%s: %s, %s <strong>%s</strong>.",
sprintf (Gbl.Alert.Txt,"%s: %s, %s <strong>%s</strong>.",
Txt_Copy_source,TxtClipboardZone,
TxtFileType[Gbl.FileBrowser.Clipboard.FileType],
FileNameToShow);
}
else
// The root folder
sprintf (Gbl.Message,"%s: %s, %s.",
sprintf (Gbl.Alert.Txt,"%s: %s, %s.",
Txt_Copy_source,TxtClipboardZone,
Txt_all_files_inside_the_root_folder);
Lay_ShowAlert (Lay_CLIPBOARD,Gbl.Message);
Lay_ShowAlert (Lay_CLIPBOARD,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -7562,7 +7562,7 @@ static void Brw_PasteClipboard (void)
&FirstFilCod))
{
/***** Write message of success *****/
sprintf (Gbl.Message,"%s<br />"
sprintf (Gbl.Alert.Txt,"%s<br />"
"%s: %u<br />"
"%s: %u<br />"
"%s: %u",
@ -7570,7 +7570,7 @@ static void Brw_PasteClipboard (void)
Txt_Files_copied ,Pasted.NumFiles,
Txt_Links_copied ,Pasted.NumLinks,
Txt_Folders_copied,Pasted.NumFolds);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Notify new files *****/
if (Pasted.NumFiles ||
@ -7712,21 +7712,21 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
switch (FileType)
{
case Brw_IS_FILE:
sprintf (Gbl.Message,Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
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,
FileNameToShow);
break;
case Brw_IS_FOLDER:
sprintf (Gbl.Message,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
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,
FileNameToShow);
break;
case Brw_IS_LINK:
sprintf (Gbl.Message,Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
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,
FileNameToShow);
break;
default:
Lay_ShowErrorAndExit ("Can not paste unknown file type.");
}
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
}
else // Quota not exceeded
@ -7738,11 +7738,11 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
/***** Check if exists the destination file */
if (Fil_CheckIfPathExists (PathDstWithFile))
{
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
FileNameToShow);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
}
else // Destination file does not exist
@ -7754,12 +7754,12 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
{
/* Check extension of the file */
if (Str_FileIsHTML (FileNameOrg))
Mrk_CheckFileOfMarks (PathOrg,&Marks); // Gbl.Message contains feedback text
Mrk_CheckFileOfMarks (PathOrg,&Marks); // Gbl.Alert.Txt contains feedback text
else
{
sprintf (Gbl.Message,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,
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,
FileNameToShow);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
}
}
@ -7771,10 +7771,10 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size;
if (Brw_CheckIfQuotaExceded ())
{
sprintf (Gbl.Message,FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_disk_quota :
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 :
Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_disk_quota,
FileNameToShow);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
}
else // Quota not exceeded
@ -7814,9 +7814,9 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size;
if (Brw_CheckIfQuotaExceded ())
{
sprintf (Gbl.Message,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_disk_quota,
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_disk_quota,
FileNameToShow);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
}
else // Quota not exceded
@ -7938,9 +7938,9 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1])
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_Create_folder,NULL,NULL);
sprintf (Gbl.Message,Txt_You_can_create_a_new_folder_inside_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_You_can_create_a_new_folder_inside_the_folder_X,
FileNameToShow);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Folder *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -7977,9 +7977,9 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
Lay_StartRoundFrame ("95%",Txt_Upload_files,NULL,NULL);
/***** Help message *****/
sprintf (Gbl.Message,Txt_or_you_can_upload_new_files_to_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_or_you_can_upload_new_files_to_the_folder_X,
FileNameToShow);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Form to upload files using the library Dropzone.js *****/
// Use min-height:125px; or other number to stablish the height?
@ -8038,9 +8038,9 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow)
Lay_StartRoundFrame (NULL,Txt_Upload_file,NULL,NULL);
/***** Help message *****/
sprintf (Gbl.Message,Txt_or_you_can_upload_a_new_file_to_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_or_you_can_upload_a_new_file_to_the_folder_X,
FileNameToShow);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Form to upload one files using the classic way *****/
Act_FormStart (Brw_ActUploadFileClassic[Gbl.FileBrowser.Type]);
@ -8080,9 +8080,9 @@ static void Brw_PutFormToPasteAFileOrFolder (const char *FileNameToShow)
Lay_StartRoundFrame (NULL,Txt_Paste,NULL,NULL);
/***** Help message *****/
sprintf (Gbl.Message,Txt_or_you_can_make_a_file_copy_to_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_or_you_can_make_a_file_copy_to_the_folder_X,
FileNameToShow);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Send button and end frame *****/
Lay_EndRoundFrameWithButton (Lay_CREATE_BUTTON,Txt_Paste);
@ -8115,9 +8115,9 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow)
Lay_StartRoundFrame (NULL,Txt_Create_link,NULL,NULL);
/***** Help message *****/
sprintf (Gbl.Message,Txt_or_you_can_create_a_new_link_inside_the_folder_X,
sprintf (Gbl.Alert.Txt,Txt_or_you_can_create_a_new_link_inside_the_folder_X,
FileNameToShow);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** URL *****/
fprintf (Gbl.F.Out,"<table>"
@ -8202,9 +8202,9 @@ void Brw_RecFolderFileBrowser (void)
if (Brw_CheckIfQuotaExceded ())
{
Fil_RemoveTree (Path);
sprintf (Gbl.Message,Txt_Can_not_create_the_folder_X_because_it_would_exceed_the_disk_quota,
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_folder_X_because_it_would_exceed_the_disk_quota,
Gbl.FileBrowser.NewFilFolLnkName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -8223,9 +8223,9 @@ void Brw_RecFolderFileBrowser (void)
Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.Type,Gbl.FileBrowser.Level,
Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName,FileNameToShow);
sprintf (Gbl.Message,Txt_The_folder_X_has_been_created_inside_the_folder_Y,
sprintf (Gbl.Alert.Txt,Txt_The_folder_X_has_been_created_inside_the_folder_Y,
Gbl.FileBrowser.NewFilFolLnkName,FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else
@ -8233,9 +8233,9 @@ void Brw_RecFolderFileBrowser (void)
switch (errno)
{
case EEXIST:
sprintf (Gbl.Message,Txt_Can_not_create_the_folder_X_because_there_is_already_a_folder_or_a_file_with_that_name,
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_folder_X_because_there_is_already_a_folder_or_a_file_with_that_name,
Gbl.FileBrowser.NewFilFolLnkName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
break;
case EACCES:
Lay_ShowErrorAndExit ("Write forbidden.");
@ -8247,7 +8247,7 @@ void Brw_RecFolderFileBrowser (void)
}
}
else // Folder name not valid
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
Lay_ShowErrorAndExit (Txt_You_can_not_create_folders_here); // It's difficult, but not impossible that a user sees this message
@ -8303,7 +8303,7 @@ void Brw_RenFolderFileBrowser (void)
case ENOTEMPTY:
case EEXIST:
case ENOTDIR:
sprintf (Gbl.Message,Txt_The_folder_name_X_has_not_changed_because_there_is_already_a_folder_or_a_file_with_the_name_Y,
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,
Gbl.FileBrowser.FilFolLnkName,Gbl.FileBrowser.NewFilFolLnkName);
break;
case EACCES:
@ -8313,7 +8313,7 @@ void Brw_RenFolderFileBrowser (void)
Lay_ShowErrorAndExit ("Can not rename folder.");
break;
}
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Success
{
@ -8338,22 +8338,22 @@ void Brw_RenFolderFileBrowser (void)
NewPathInTree);
/* Write message of confirmation */
sprintf (Gbl.Message,Txt_The_folder_name_X_has_changed_to_Y,
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_changed_to_Y,
Gbl.FileBrowser.FilFolLnkName,
Gbl.FileBrowser.NewFilFolLnkName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // Names are equal. This may happens if we have press INTRO without changing the name
{
sprintf (Gbl.Message,Txt_The_folder_name_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_not_changed,
Gbl.FileBrowser.FilFolLnkName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
else // Folder name not valid
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
Lay_ShowErrorAndExit (Txt_You_can_not_rename_this_folder);
@ -8389,7 +8389,7 @@ void Brw_RcvFileInFileBrwDropzone (void)
else
fprintf (stdout,"Status: 501 Not Implemented\r\n\r\n"
"%s\n",
Gbl.Message);
Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -8400,7 +8400,7 @@ void Brw_RcvFileInFileBrwClassic (void)
{
/***** Receive file and show feedback message *****/
if (!Brw_RcvFileInFileBrw (Brw_CLASSIC_UPLOAD))
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
/***** Show again file browser *****/
Brw_ShowAgainFileBrowserOrWorks ();
@ -8454,9 +8454,9 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
if (Gbl.FileBrowser.NewFilFolLnkName[0])
{
/***** Check if uploading this kind of file is allowed *****/
if (Brw_CheckIfUploadIsAllowed (MIMEType)) // Gbl.Message contains feedback text
if (Brw_CheckIfUploadIsAllowed (MIMEType)) // Gbl.Alert.Txt contains feedback text
{
if (Str_ConvertFilFolLnkNameToValid (Gbl.FileBrowser.NewFilFolLnkName)) // Gbl.Message contains feedback text
if (Str_ConvertFilFolLnkNameToValid (Gbl.FileBrowser.NewFilFolLnkName)) // Gbl.Alert.Txt contains feedback text
{
/* Gbl.FileBrowser.NewFilFolLnkName holds the name of the new file */
sprintf (Path,"%s/%s",
@ -8472,19 +8472,19 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
/* Check if the destination file exists */
if (Fil_CheckIfPathExists (Path))
{
sprintf (Gbl.Message,Txt_UPLOAD_FILE_X_file_already_exists_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_file_already_exists_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
}
else // Destination file does not exist
{
/* End receiving the file */
sprintf (PathTmp,"%s.tmp",Path);
FileIsValid = Fil_EndReceptionOfFile (PathTmp,Param); // Gbl.Message contains feedback text
FileIsValid = Fil_EndReceptionOfFile (PathTmp,Param); // Gbl.Alert.Txt contains feedback text
/* Check if the content of the file of marks is valid */
if (FileIsValid)
if (AdminMarks)
if (!Mrk_CheckFileOfMarks (PathTmp,&Marks)) // Gbl.Message contains feedback text
if (!Mrk_CheckFileOfMarks (PathTmp,&Marks)) // Gbl.Alert.Txt contains feedback text
FileIsValid = false;
if (FileIsValid)
@ -8493,7 +8493,7 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
if (rename (PathTmp,Path)) // Fail
{
Fil_RemoveTree (PathTmp);
sprintf (Gbl.Message,Txt_UPLOAD_FILE_could_not_create_file_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_could_not_create_file_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
}
else // Success
@ -8504,7 +8504,7 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
if (Brw_CheckIfQuotaExceded ())
{
Fil_RemoveTree (Path);
sprintf (Gbl.Message,Txt_UPLOAD_FILE_X_quota_exceeded_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_quota_exceeded_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
}
else
@ -8526,10 +8526,10 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.Type,Gbl.FileBrowser.Level,
Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName,FileNameToShow);
sprintf (Gbl.Message,Txt_The_file_X_has_been_placed_inside_the_folder_Y,
sprintf (Gbl.Alert.Txt,Txt_The_file_X_has_been_placed_inside_the_folder_Y,
Gbl.FileBrowser.NewFilFolLnkName,
FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
UploadSucessful = true;
@ -8581,10 +8581,10 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
}
}
else // Empty filename
sprintf (Gbl.Message,"%s",Txt_UPLOAD_FILE_You_must_specify_the_file_NO_HTML);
sprintf (Gbl.Alert.Txt,"%s",Txt_UPLOAD_FILE_You_must_specify_the_file_NO_HTML);
}
else // I do not have permission to create files here
sprintf (Gbl.Message,"%s",Txt_UPLOAD_FILE_Forbidden_NO_HTML);
sprintf (Gbl.Alert.Txt,"%s",Txt_UPLOAD_FILE_Forbidden_NO_HTML);
return UploadSucessful;
}
@ -8653,7 +8653,7 @@ void Brw_RecLinkFileBrowser (void)
FileName);
/* Convert the last name in URL to a valid filename */
if (Str_ConvertFilFolLnkNameToValid (FileName)) // Gbl.Message contains feedback text
if (Str_ConvertFilFolLnkNameToValid (FileName)) // Gbl.Alert.Txt contains feedback text
{
/* The name of the file with the link will be the FileName.url */
sprintf (Path,"%s/%s",Gbl.FileBrowser.Priv.PathAboveRootFolder,Gbl.FileBrowser.Priv.FullPathInTree);
@ -8669,9 +8669,9 @@ void Brw_RecLinkFileBrowser (void)
/* Check if the URL file exists */
if (Fil_CheckIfPathExists (Path))
{
sprintf (Gbl.Message,Txt_Can_not_create_the_link_X_because_there_is_already_a_folder_or_a_link_with_that_name,
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_link_X_because_there_is_already_a_folder_or_a_link_with_that_name,
FileName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // URL file does not exist
{
@ -8690,9 +8690,9 @@ void Brw_RecLinkFileBrowser (void)
if (Brw_CheckIfQuotaExceded ())
{
Fil_RemoveTree (Path);
sprintf (Gbl.Message,Txt_Can_not_create_the_link_X_because_it_would_exceed_the_disk_quota,
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_link_X_because_it_would_exceed_the_disk_quota,
FileName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -8711,9 +8711,9 @@ void Brw_RecLinkFileBrowser (void)
Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.Type,Gbl.FileBrowser.Level,
Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName,FileNameToShow);
sprintf (Gbl.Message,Txt_The_link_X_has_been_placed_inside_the_folder_Y,
sprintf (Gbl.Alert.Txt,Txt_The_link_X_has_been_placed_inside_the_folder_Y,
FileName,FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
FileMetadata.FilCod = FilCod;
Brw_GetFileMetadataByCod (&FileMetadata);
@ -8765,7 +8765,7 @@ void Brw_RecLinkFileBrowser (void)
/*****************************************************************************/
// Returns true if file type is allowed
// Returns false if MIME type or extension are not allowed
// On error, Gbl.Message will contain feedback text
// On error, Gbl.Alert.Txt will contain feedback text
static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
{
@ -8790,14 +8790,14 @@ static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
if (strcmp (MIMEType,"application/octetstream"))
if (strcmp (MIMEType,"application/octet"))
{ // MIME type forbidden
sprintf (Gbl.Message,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType);
return false;
}
}
else
{
sprintf (Gbl.Message,Txt_UPLOAD_FILE_X_not_HTML_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_not_HTML_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
return false;
}
@ -8825,14 +8825,14 @@ static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
}
if (!MIMETypeIsAllowed)
{
sprintf (Gbl.Message,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType);
return false;
}
}
else
{
sprintf (Gbl.Message,Txt_UPLOAD_FILE_X_extension_not_allowed_NO_HTML,
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_extension_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
return false;
}
@ -8866,9 +8866,9 @@ void Brw_SetDocumentAsVisible (void)
Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.Type,Gbl.FileBrowser.Level,
Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName,FileNameToShow);
sprintf (Gbl.Message,Txt_FILE_FOLDER_OR_LINK_X_is_now_visible,
sprintf (Gbl.Alert.Txt,Txt_FILE_FOLDER_OR_LINK_X_is_now_visible,
FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show again the file browser *****/
Brw_ShowAgainFileBrowserOrWorks ();
@ -8899,8 +8899,8 @@ void Brw_SetDocumentAsHidden (void)
Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.Type,Gbl.FileBrowser.Level,
Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName,FileNameToShow);
sprintf (Gbl.Message,Txt_FILE_FOLDER_OR_LINK_X_is_now_hidden,FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_FILE_FOLDER_OR_LINK_X_is_now_hidden,FileNameToShow);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show again the file browser *****/
Brw_ShowAgainFileBrowserOrWorks ();
@ -9858,16 +9858,16 @@ void Brw_ChgFileMetadata (void)
}
/***** Write message of confirmation *****/
sprintf (Gbl.Message,Txt_The_properties_of_file_X_have_been_saved,
sprintf (Gbl.Alert.Txt,Txt_The_properties_of_file_X_have_been_saved,
Gbl.FileBrowser.FilFolLnkName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{
/***** Write message of error *****/
sprintf (Gbl.Message,Txt_You_dont_have_permission_to_change_the_properties_of_file_X,
sprintf (Gbl.Alert.Txt,Txt_You_dont_have_permission_to_change_the_properties_of_file_X,
Gbl.FileBrowser.FilFolLnkName);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
/***** Show again the file browser *****/
@ -11093,9 +11093,9 @@ void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs,Cns_Quie
/***** Write message *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Works_of_X_in_Y_removed,
sprintf (Gbl.Alert.Txt,Txt_Works_of_X_in_Y_removed,
UsrDat->FullName,Crs->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -11136,9 +11136,9 @@ void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat,Cns_QuietOrVerbose_t Qu
/***** Write message *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_The_works_of_X_have_been_removed_in_a_total_of_Y_of_his_her_Z_courses,
sprintf (Gbl.Alert.Txt,Txt_The_works_of_X_have_been_removed_in_a_total_of_Y_of_his_her_Z_courses,
UsrDat->FullName,NumCrssWorksRemoved,(unsigned) NumRows);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -11653,13 +11653,13 @@ void Brw_RemoveOldFilesBriefcase (void)
Brw_RemoveOldFilesInBrowser (Months,&Removed);
/***** Success message *****/
sprintf (Gbl.Message,"%s: %u<br />"
sprintf (Gbl.Alert.Txt,"%s: %u<br />"
"%s: %u<br />"
"%s: %u",
Txt_Files_removed ,Removed.NumFiles,
Txt_Links_removed ,Removed.NumLinks,
Txt_Folders_removed,Removed.NumFolds);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show again the file browser *****/

View File

@ -1031,12 +1031,12 @@ void Fol_FollowUsr1 (void)
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0));
}
Gbl.AlertType = Lay_SUCCESS;
Gbl.Alert.Type = Lay_SUCCESS;
}
else
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
}
@ -1044,15 +1044,15 @@ void Fol_FollowUsr2 (void)
{
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
if (Gbl.AlertType == Lay_SUCCESS)
if (Gbl.Alert.Type == Lay_SUCCESS)
/***** Show user's profile again *****/
if (!Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
if (Gbl.AlertType != Lay_SUCCESS)
if (Gbl.Alert.Type != Lay_SUCCESS)
Lay_ShowPendingAlert ();
}
@ -1079,19 +1079,19 @@ void Fol_UnfollowUsr1 (void)
Gbl.Usrs.Other.UsrDat.UsrCod);
DB_QueryREPLACE (Query,"can not unfollow user");
}
Gbl.AlertType = Lay_SUCCESS;
Gbl.Alert.Type = Lay_SUCCESS;
}
else
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
}
void Fol_UnfollowUsr2 (void)
{
/***** Get user to be unfollowed *****/
if (Gbl.AlertType == Lay_SUCCESS)
if (Gbl.Alert.Type == Lay_SUCCESS)
{
/***** Show user's profile again *****/
if (!Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat)) // I can not view user's profile

View File

@ -4109,9 +4109,9 @@ void For_RequestRemoveThread (void)
fprintf (Gbl.F.Out,"<section id=\"%s\">",For_ID_REMOVE_THREAD_SECTION);
if (Subject[0])
{
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_entire_thread_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_entire_thread_X,
Subject);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
}
else
Lay_ShowAlertAndButton1 (Lay_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread);
@ -4167,9 +4167,9 @@ void For_RemoveThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Message,Txt_Thread_X_removed,Subject);
sprintf (Gbl.Alert.Txt,Txt_Thread_X_removed,Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
else
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
@ -4204,9 +4204,9 @@ void For_CutThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Message,Txt_Thread_X_marked_to_be_moved,Subject);
sprintf (Gbl.Alert.Txt,Txt_Thread_X_marked_to_be_moved,Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
else
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
@ -4241,10 +4241,10 @@ void For_PasteThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Message,Txt_The_thread_X_is_already_in_this_forum,
sprintf (Gbl.Alert.Txt,Txt_The_thread_X_is_already_in_this_forum,
Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Lay_WARNING,Gbl.Message);
Lay_WARNING,Gbl.Alert.Txt);
}
else
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
@ -4261,10 +4261,10 @@ void For_PasteThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Message,Txt_Thread_X_moved_to_this_forum,
sprintf (Gbl.Alert.Txt,Txt_Thread_X_moved_to_this_forum,
Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
else
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,

View File

@ -120,7 +120,7 @@ void Gbl_InitializeGlobals (void)
Gbl.Form.Num = -1; // Number of form. It's increased by 1 at the begin of each form
Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms
Gbl.AlertType = Lay_NONE; // Used to show alert in a posteriori function
Gbl.Alert.Type = Lay_NONE; // Used to show alert in a posteriori function
Gbl.DB.DatabaseIsOpen = false;
Gbl.DB.LockedTables = false;

View File

@ -100,8 +100,11 @@ struct Globals
char UniqueId[32 + Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 10 + 1]; // Unique identifier string used in forms
bool Inside; // Set to true inside a form to avoid nested forms
} Form;
Lay_AlertType_t AlertType; // Used in a posteriori function to write success / warning message
struct
{
Lay_AlertType_t Type;
char Txt[Lay_MAX_BYTES_ALERT + 1];
} Alert; // Used in a posteriori function to write success / warning message
struct
{
size_t ContentLength;
@ -182,7 +185,6 @@ struct Globals
time_t StartExecutionTimeUTC;
struct DateTime Now;
struct Date Yesterday;
char Message[Lay_MAX_BYTES_ALERT + 1]; // String for alerts
char Title[Lay_MAX_BYTES_TITLE + 1]; // String for the help message in a link
unsigned RowEvenOdd; // To alternate row colors in listings
char *ColorRows[2];

View File

@ -257,9 +257,9 @@ static void Grp_EditGroupTypes (void)
Grp_ListGroupTypesForEdition ();
else // No group types found in this course
{
sprintf (Gbl.Message,Txt_There_are_no_types_of_group_in_the_course_X,
sprintf (Gbl.Alert.Txt,Txt_There_are_no_types_of_group_in_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** Put a form to create a new group type *****/
@ -288,9 +288,9 @@ static void Grp_EditGroups (void)
Grp_ListGroupsForEdition ();
else // There are group types, but there aren't groups
{
sprintf (Gbl.Message,Txt_No_groups_have_been_created_in_the_course_X,
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** Put a form to create a new group *****/
@ -1023,18 +1023,18 @@ 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 ==>
remove user from the group to which he belongs */
Grp_RemoveUsrFromGroup (UsrDat->UsrCod,LstGrpsHeBelongs.GrpCods[NumGrpHeBelongs]);
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_the_group_of_type_Y_to_which_it_belonged,
sprintf (Gbl.Alert.Txt,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);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
if (!AlreadyRegisteredInGrp) // If the user does not belong to the selected group
{
Grp_AddUsrToGroup (UsrDat,LstGrps->GrpCods[NumGrpSel]);
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_enroled_in_the_group_of_type_Y_Z,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_group_of_type_Y_Z,
UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName,
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrpThisType].GrpName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
break; // Once we know the type of a selected group, it's not necessary to check the rest of types
@ -1080,15 +1080,15 @@ unsigned Grp_RemoveUsrFromGroups (struct UsrData *UsrDat,struct ListCodGrps *Lst
/***** Write message to inform about how many groups the student has been removed from *****/
if (NumGrpsHeIsRemoved == 0)
sprintf (Gbl.Message,Txt_THE_USER_X_has_not_been_removed_from_any_group,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_not_been_removed_from_any_group,
UsrDat->FullName);
else if (NumGrpsHeIsRemoved == 1)
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_one_group,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_one_group,
UsrDat->FullName);
else // NumGrpsHeIsRemoved > 1
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_Y_groups,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_Y_groups,
UsrDat->FullName,NumGrpsHeIsRemoved);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Free the list of groups of this type to which the user belonged *****/
Grp_FreeListCodGrp (&LstGrpsHeBelongs);
@ -1117,9 +1117,9 @@ void Grp_RemUsrFromAllGrpsInCrs (struct UsrData *UsrDat,struct Course *Crs,Cns_Q
/***** Write message to show the change made *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_all_groups_of_the_course_Y,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_groups_of_the_course_Y,
UsrDat->FullName,Crs->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -1140,9 +1140,9 @@ void Grp_RemUsrFromAllGrps (struct UsrData *UsrDat,Cns_QuietOrVerbose_t QuietOrV
/***** Write message to show the change made *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_all_groups_in_all_courses,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_groups_in_all_courses,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -1699,9 +1699,9 @@ void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
}
else // This course has no groups
{
sprintf (Gbl.Message,Txt_No_groups_have_been_created_in_the_course_X,
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Button to create group *****/
if (ICanEdit)
@ -1753,19 +1753,19 @@ static void Grp_ShowWarningToStdsToChangeGrps (void)
{
if (GrpTyp->MandatoryEnrolment)
{
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
GrpTyp->GrpTypName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
GrpTyp->GrpTypName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
}
@ -3280,7 +3280,7 @@ void Grp_RecFormNewGrpTyp (void)
if (Grp_CheckIfGroupTypeNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,-1L))
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_type_of_group_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_already_exists,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else // Add new group type to database
@ -3288,18 +3288,18 @@ void Grp_RecFormNewGrpTyp (void)
Grp_CreateGroupType ();
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_Created_new_type_of_group_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_type_of_group_X,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
}
else // If there is not a group type name
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_type_of_group);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_name_of_the_new_type_of_group);
}
/***** Show the form again *****/
Grp_ReqEditGroupsInternal (AlertType,Gbl.Message,
Grp_ReqEditGroupsInternal (AlertType,Gbl.Alert.Txt,
Lay_INFO,NULL);
}
@ -3348,7 +3348,7 @@ void Grp_RecFormNewGrp (void)
if (Grp_CheckIfGroupNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod,Gbl.CurrentCrs.Grps.GrpName,-1L))
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_group_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,
Gbl.CurrentCrs.Grps.GrpName);
}
else // Add new group to database
@ -3357,25 +3357,25 @@ void Grp_RecFormNewGrp (void)
/* Write success message */
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_Created_new_group_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_group_X,
Gbl.CurrentCrs.Grps.GrpName);
}
}
else // If there is not a group name
{
AlertType = Lay_ERROR;
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_group);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_name_of_the_new_group);
}
}
else // Invalid group type
{
AlertType = Lay_ERROR;
sprintf (Gbl.Message,"%s","Wrong type of group.");
sprintf (Gbl.Alert.Txt,"%s","Wrong type of group.");
}
/***** Show the form again *****/
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
AlertType,Gbl.Message);
AlertType,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3504,12 +3504,12 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps)
/***** Show question and button to remove type of group *****/
/* Start alert */
if (NumGrps == 1)
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
else
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NumGrps);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Lay_ShowAlertAndButton2 (ActRemGrpTyp,Grp_SECTION_GROUP_TYPES,
@ -3557,15 +3557,15 @@ static void Grp_AskConfirmRemGrp (void)
/***** Show question and button to remove group *****/
/* Start alert */
if (NumStds == 0)
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_group_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X,
GrpDat.GrpName);
else if (NumStds == 1)
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_group_X_1_student_,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X_1_student_,
GrpDat.GrpName);
else
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
GrpDat.GrpName,NumStds);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Lay_ShowAlertAndButton2 (ActRemGrp,Grp_SECTION_GROUPS,Grp_PutParamRemGrp,
@ -3660,11 +3660,11 @@ static void Grp_RemoveGroupTypeCompletely (void)
DB_QueryDELETE (Query,"can not remove a type of group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Type_of_group_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Type_of_group_X_removed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
/***** Show the form again *****/
Grp_ReqEditGroupsInternal (Lay_SUCCESS,Gbl.Message,
Grp_ReqEditGroupsInternal (Lay_SUCCESS,Gbl.Alert.Txt,
Lay_INFO,NULL);
}
@ -3710,11 +3710,11 @@ static void Grp_RemoveGroupCompletely (void)
DB_QueryDELETE (Query,"can not remove a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Group_X_removed,GrpDat.GrpName);
sprintf (Gbl.Alert.Txt,Txt_Group_X_removed,GrpDat.GrpName);
/***** Show the form again *****/
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3741,12 +3741,12 @@ void Grp_OpenGroup (void)
DB_QueryUPDATE (Query,"can not open a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_group_X_is_now_open,GrpDat.GrpName);
sprintf (Gbl.Alert.Txt,Txt_The_group_X_is_now_open,GrpDat.GrpName);
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.Open = true;
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3773,12 +3773,12 @@ void Grp_CloseGroup (void)
DB_QueryUPDATE (Query,"can not close a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_group_X_is_now_closed,GrpDat.GrpName);
sprintf (Gbl.Alert.Txt,Txt_The_group_X_is_now_closed,GrpDat.GrpName);
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.Open = false;
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3805,13 +3805,13 @@ void Grp_EnableFileZonesGrp (void)
DB_QueryUPDATE (Query,"can not enable file zones of a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_File_zones_of_the_group_X_are_now_enabled,
sprintf (Gbl.Alert.Txt,Txt_File_zones_of_the_group_X_are_now_enabled,
GrpDat.GrpName);
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.FileZones = true;
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3838,13 +3838,13 @@ void Grp_DisableFileZonesGrp (void)
DB_QueryUPDATE (Query,"can not disable file zones of a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_File_zones_of_the_group_X_are_now_disabled,
sprintf (Gbl.Alert.Txt,Txt_File_zones_of_the_group_X_are_now_disabled,
GrpDat.GrpName);
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.FileZones = false;
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
Lay_SUCCESS,Gbl.Message);
Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3876,7 +3876,7 @@ void Grp_ChangeGroupType (void)
if (Grp_CheckIfGroupNameExists (NewGrpTypCod,GrpDat.GrpName,-1L))
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_group_X_already_exists,GrpDat.GrpName);
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,GrpDat.GrpName);
}
else
{
@ -3887,14 +3887,14 @@ void Grp_ChangeGroupType (void)
/***** Write message to show the change made *****/
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_type_of_group_of_the_group_X_has_changed,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_of_the_group_X_has_changed,
GrpDat.GrpName);
}
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod = NewGrpTypCod;
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
AlertType,Gbl.Message);
AlertType,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3926,7 +3926,7 @@ void Grp_ChangeMandatGrpTyp (void)
if (Gbl.CurrentCrs.Grps.GrpTyp.MandatoryEnrolment == NewMandatoryEnrolment)
{
AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else
@ -3940,7 +3940,7 @@ void Grp_ChangeMandatGrpTyp (void)
/***** Write message to show the change made *****/
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
@ -3948,7 +3948,7 @@ void Grp_ChangeMandatGrpTyp (void)
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.GrpTyp.MandatoryEnrolment = NewMandatoryEnrolment;
Grp_ReqEditGroupsInternal (AlertType,Gbl.Message,
Grp_ReqEditGroupsInternal (AlertType,Gbl.Alert.Txt,
Lay_INFO,NULL);
}
@ -3981,7 +3981,7 @@ void Grp_ChangeMultiGrpTyp (void)
if (Gbl.CurrentCrs.Grps.GrpTyp.MultipleEnrolment == NewMultipleEnrolment)
{
AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else
@ -3996,7 +3996,7 @@ void Grp_ChangeMultiGrpTyp (void)
/***** Write message to show the change made *****/
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
@ -4004,7 +4004,7 @@ void Grp_ChangeMultiGrpTyp (void)
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.GrpTyp.MultipleEnrolment = NewMultipleEnrolment;
Grp_ReqEditGroupsInternal (AlertType,Gbl.Message,
Grp_ReqEditGroupsInternal (AlertType,Gbl.Alert.Txt,
Lay_INFO,NULL);
}
@ -4040,10 +4040,10 @@ void Grp_ChangeOpenTimeGrpTyp (void)
DB_QueryUPDATE (Query,"can not update enrolment type of a type of group");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,"%s",Txt_The_date_time_of_opening_of_groups_has_changed);
sprintf (Gbl.Alert.Txt,"%s",Txt_The_date_time_of_opening_of_groups_has_changed);
/***** Show the form again *****/
Grp_ReqEditGroupsInternal (Lay_SUCCESS,Gbl.Message,
Grp_ReqEditGroupsInternal (Lay_SUCCESS,Gbl.Alert.Txt,
Lay_INFO,NULL);
}
@ -4081,7 +4081,7 @@ void Grp_ChangeMaxStdsGrp (void)
if (GrpDat.MaxStudents == NewMaxStds)
{
AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed,
GrpDat.GrpName);
}
else
@ -4094,17 +4094,17 @@ void Grp_ChangeMaxStdsGrp (void)
/***** Write message to show the change made *****/
AlertType = Lay_SUCCESS;
if (NewMaxStds > Grp_MAX_STUDENTS_IN_A_GROUP)
sprintf (Gbl.Message,Txt_The_group_X_now_has_no_limit_of_students,
sprintf (Gbl.Alert.Txt,Txt_The_group_X_now_has_no_limit_of_students,
GrpDat.GrpName);
else
sprintf (Gbl.Message,Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y,
sprintf (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y,
GrpDat.GrpName,NewMaxStds);
}
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.MaxStudents = NewMaxStds;
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
AlertType,Gbl.Message);
AlertType,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -4163,7 +4163,7 @@ void Grp_RenameGroupType (void)
if (!NewNameGrpTyp[0])
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_type_of_group_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_type_of_group_X_empty,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else
@ -4175,7 +4175,7 @@ void Grp_RenameGroupType (void)
if (Grp_CheckIfGroupTypeNameExists (NewNameGrpTyp,Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod))
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_type_of_group_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_already_exists,
NewNameGrpTyp);
}
else
@ -4189,14 +4189,14 @@ void Grp_RenameGroupType (void)
/***** Write message to show the change made *****/
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_type_of_group_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_has_been_renamed_as_Y,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NewNameGrpTyp);
}
}
else // The same name
{
AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_type_of_group_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_type_of_group_X_has_not_changed,
NewNameGrpTyp);
}
}
@ -4204,7 +4204,7 @@ void Grp_RenameGroupType (void)
/***** Show the form again *****/
Str_Copy (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NewNameGrpTyp,
Grp_MAX_BYTES_GROUP_TYPE_NAME);
Grp_ReqEditGroupsInternal (AlertType,Gbl.Message,
Grp_ReqEditGroupsInternal (AlertType,Gbl.Alert.Txt,
Lay_INFO,NULL);
}
@ -4239,7 +4239,7 @@ void Grp_RenameGroup (void)
if (!NewNameGrp[0])
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_group_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_group_X_empty,
GrpDat.GrpName);
}
else
@ -4251,7 +4251,7 @@ void Grp_RenameGroup (void)
if (Grp_CheckIfGroupNameExists (GrpDat.GrpTypCod,NewNameGrp,Gbl.CurrentCrs.Grps.GrpCod))
{
AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_group_X_already_exists,NewNameGrp);
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,NewNameGrp);
}
else
{
@ -4262,14 +4262,14 @@ void Grp_RenameGroup (void)
/***** Write message to show the change made *****/
AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_group_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_group_X_has_been_renamed_as_Y,
GrpDat.GrpName,NewNameGrp);
}
}
else // The same name
{
AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_group_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_group_X_has_not_changed,
NewNameGrp);
}
}
@ -4278,7 +4278,7 @@ void Grp_RenameGroup (void)
Str_Copy (Gbl.CurrentCrs.Grps.GrpName,NewNameGrp,
Grp_MAX_BYTES_GROUP_NAME);
Grp_ReqEditGroupsInternal (Lay_INFO,NULL,
AlertType,Gbl.Message);
AlertType,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -107,11 +107,11 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
if (Gbl.Usrs.Me.Logged &&
!Gbl.Usrs.Me.MyCrss.Num)
{
sprintf (Gbl.Message,"%s<br />%s<br />%s",
sprintf (Gbl.Alert.Txt,"%s<br />%s<br />%s",
Txt_You_are_not_enroled_in_any_course[Gbl.Usrs.Me.UsrDat.Sex],
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);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** Contextual buttons *****/

View File

@ -651,8 +651,8 @@ void Hld_RemoveHoliday1 (void)
DB_QueryDELETE (Query,"can not remove a holiday");
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_Holiday_X_removed,Hld.Name);
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Holiday_X_removed,Hld.Name);
}
@ -701,8 +701,8 @@ void Hld_ChangeHolidayPlace1 (void)
Plc_MAX_BYTES_PLACE_FULL_NAME);
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_place_of_the_holiday_X_has_changed_to_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_place_of_the_holiday_X_has_changed_to_Y,
Hld->Name,NewPlace.FullName);
}
@ -745,8 +745,8 @@ void Hld_ChangeHolidayType1 (void)
DB_QueryUPDATE (Query,"can not update the type of a holiday");
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_type_of_the_holiday_X_has_changed,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_the_holiday_X_has_changed,
Hld->Name);
}
@ -844,9 +844,9 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
Dat_AssignDate (PtrDate,&NewDate);
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
Gbl.Alert.Type = Lay_SUCCESS;
Dat_ConvDateToDateStr (&NewDate,StrDate);
sprintf (Gbl.Message,Txt_The_date_of_the_holiday_X_has_changed_to_Y,
sprintf (Gbl.Alert.Txt,Txt_The_date_of_the_holiday_X_has_changed_to_Y,
Hld->Name,StrDate);
}
@ -892,8 +892,8 @@ void Hld_RenameHoliday1 (void)
/***** Check if new name is empty *****/
if (!NewHldName[0])
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
Hld->Name);
}
else
@ -910,14 +910,14 @@ void Hld_RenameHoliday1 (void)
Hld_MAX_BYTES_HOLIDAY_NAME);
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_name_of_the_holiday_X_has_changed_to_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_holiday_X_has_changed_to_Y,
Hld->Name,NewHldName);
}
else // The same name
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_holiday_X_has_not_changed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_holiday_X_has_not_changed,
Hld->Name);
}
}
@ -1147,14 +1147,14 @@ void Hld_RecFormNewHoliday1 (void)
Hld_CreateHoliday (Hld);
/* Success message */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_Created_new_holiday_X,Hld->Name);
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_holiday_X,Hld->Name);
}
else // If there is not a holiday name
{
/* Error message */
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_holiday);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_You_must_specify_the_name_of_the_new_holiday);
}
}

View File

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

View File

@ -519,9 +519,9 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss)
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
/***** Show warning *****/
sprintf (Gbl.Message,Txt_The_list_of_X_courses_is_too_large_to_be_displayed,
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_courses_is_too_large_to_be_displayed,
NumCrss);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
/***** Put form to confirm that I want to see the big list *****/
Act_FormStart (Gbl.Action.Act);

View File

@ -2228,9 +2228,9 @@ void Inf_ReceiveURLInfo (void)
fclose (FileURL);
/***** Write message *****/
sprintf (Gbl.Message,Txt_The_URL_X_has_been_updated,
sprintf (Gbl.Alert.Txt,Txt_The_URL_X_has_been_updated,
Gbl.CurrentCrs.Info.URL);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
URLIsOK = true;
}
else
@ -2297,9 +2297,9 @@ void Inf_ReceivePagInfo (void)
WrongType = true;
if (WrongType)
{
sprintf (Gbl.Message,Txt_The_file_type_is_X_and_should_be_HTML_or_ZIP,
sprintf (Gbl.Alert.Txt,Txt_The_file_type_is_X_and_should_be_HTML_or_ZIP,
MIMEType);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else
{

View File

@ -1716,9 +1716,9 @@ void Ins_RemoveInstitution (void)
DB_QueryDELETE (Query,"can not remove an institution");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Institution_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Institution_X_removed,
Ins.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1796,8 +1796,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
/***** Check if new name is empty *****/
if (!NewInsName[0])
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_institution_X_empty,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_institution_X_empty,
CurrentInsName);
}
else
@ -1808,8 +1808,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
/***** If institution was in database... *****/
if (Ins_CheckIfInsNameExistsInCty (ParamName,NewInsName,Ins->InsCod,Gbl.CurrentCty.Cty.CtyCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_institution_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
NewInsName);
}
else
@ -1818,8 +1818,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
Ins_UpdateInsNameDB (Ins->InsCod,FieldName,NewInsName);
/* Create message to show the change made */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_institution_X_has_been_renamed_as_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_has_been_renamed_as_Y,
CurrentInsName,NewInsName);
/* Change current institution name in order to display it properly */
@ -1829,8 +1829,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
}
else // The same name
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_institution_X_has_not_changed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_institution_X_has_not_changed,
CurrentInsName);
}
}
@ -1887,14 +1887,14 @@ void Ins_ChangeInsCtyInConfig (void)
/***** Check if it already exists an institution with the same name in the new country *****/
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.CurrentIns.Ins.ShrtName,-1L,NewCty.CtyCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_institution_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
Gbl.CurrentIns.Ins.ShrtName);
}
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.CurrentIns.Ins.FullName,-1L,NewCty.CtyCod))
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_institution_X_already_exists,
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
Gbl.CurrentIns.Ins.FullName);
}
else
@ -1908,8 +1908,8 @@ void Ins_ChangeInsCtyInConfig (void)
Hie_InitHierarchy ();
/***** Write message to show the change made *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_country_of_the_institution_X_has_changed_to_Y,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_country_of_the_institution_X_has_changed_to_Y,
Gbl.CurrentIns.Ins.FullName,NewCty.Name[Gbl.Prefs.Language]);
}
}
@ -1974,8 +1974,8 @@ void Ins_ChangeInsWWW (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to institution changed *****/
Ins_PutButtonToGoToIns (Ins);
@ -2006,8 +2006,8 @@ void Ins_ChangeInsWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
@ -2070,9 +2070,9 @@ void Ins_ChangeInsStatus (void)
Ins->Status = Status;
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_status_of_the_institution_X_has_changed,
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_institution_X_has_changed,
Ins->ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to institution changed *****/
Ins_PutButtonToGoToIns (Ins);
@ -2090,7 +2090,7 @@ void Ins_ContEditAfterChgIns (void)
/***** Write success / warning message *****/
Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
if (Gbl.Alert.Type == Lay_SUCCESS)
/***** Put button to go to institution changed *****/
Ins_PutButtonToGoToIns (&Gbl.Inss.EditingIns);
@ -2351,15 +2351,15 @@ static void Ins_RecFormRequestOrCreateIns (unsigned Status)
/***** If name of institution was in database... *****/
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Ins->ShrtName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{
sprintf (Gbl.Message,Txt_The_institution_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
Ins->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Ins->FullName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{
sprintf (Gbl.Message,Txt_The_institution_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
Ins->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new institution to database
Ins_CreateInstitution (Ins,Status);
@ -2398,9 +2398,9 @@ static void Ins_CreateInstitution (struct Instit *Ins,unsigned Status)
Ins->InsCod = DB_QueryINSERTandReturnCode (Query,"can not create institution");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_institution_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_institution_X,
Ins->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Put button to go to institution created *****/
Ins_PutButtonToGoToIns (Ins);

View File

@ -1581,7 +1581,7 @@ void Lay_EndTable (void)
/******* Write error message, close files, remove lock file, and exit ********/
/*****************************************************************************/
void Lay_ShowErrorAndExit (const char *Message)
void Lay_ShowErrorAndExit (const char *Txt)
{
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
@ -1599,8 +1599,8 @@ void Lay_ShowErrorAndExit (const char *Message)
Lay_WriteStartOfPage ();
/***** Write possible error message *****/
if (Message)
Lay_ShowAlert (Lay_ERROR,Message);
if (Txt)
Lay_ShowAlert (Lay_ERROR,Txt);
/***** Finish the page, except </body> and </html> *****/
Lay_WriteEndOfPage ();
@ -1618,7 +1618,7 @@ void Lay_ShowErrorAndExit (const char *Message)
{
/***** Log access *****/
Gbl.TimeSendInMicroseconds = 0L;
Sta_LogAccess (Message);
Sta_LogAccess (Txt);
}
else
{
@ -1635,7 +1635,7 @@ void Lay_ShowErrorAndExit (const char *Message)
Sta_ComputeTimeToSendPage ();
/***** Log access *****/
Sta_LogAccess (Message);
Sta_LogAccess (Txt);
/***** End the output *****/
if (!Gbl.Layout.HTMLEndWritten)
@ -1656,36 +1656,44 @@ void Lay_ShowErrorAndExit (const char *Message)
/***** Exit *****/
if (Gbl.WebService.IsWebService)
Svc_Exit (Message);
Svc_Exit (Txt);
exit (0);
}
/*****************************************************************************/
/*********************** Show a write-pending alert **************************/
/*****************************************************************************/
// Gbl.AlertType must be Lay_NONE or any type of alert
// If Gbl.AlertType != Lay_NONE ==> Gbl.Message must hold the message
// Gbl.Alert.Type must be Lay_NONE or any type of alert
// If Gbl.Alert.Type != Lay_NONE ==> Gbl.Alert.Txt must hold the message
void Lay_ShowPendingAlert (void)
{
if (Gbl.AlertType != Lay_NONE)
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
/***** Anything to show? *****/
if (Gbl.Alert.Type != Lay_NONE)
{
/***** Show alert *****/
Lay_ShowAlert (Gbl.Alert.Type,Gbl.Alert.Txt);
/***** Avoid writing twice the same alert if called more than once *****/
Gbl.Alert.Type = Lay_NONE;
Gbl.Alert.Txt[0] = '\0';
}
}
/*****************************************************************************/
/******************** Show an alert message to the user **********************/
/*****************************************************************************/
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message)
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Txt)
{
if (AlertType != Lay_NONE)
{
Lay_ShowAlertAndButton1 (AlertType,Message);
Lay_ShowAlertAndButton1 (AlertType,Txt);
Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL);
}
}
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message)
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Txt)
{
/****** If start of page is not written yet, do it now ******/
if (!Gbl.Layout.HTMLStartWritten)
@ -1699,8 +1707,8 @@ void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message)
fprintf (Gbl.F.Out,"<div class=\"ALERT_TXT\""
" style=\"background-image:url('%s/%s'); background-size:20px 20px;\">",
Gbl.Prefs.IconsURL,Lay_AlertIcons[AlertType]);
if (Message)
fprintf (Gbl.F.Out,"%s",Message);
if (Txt)
fprintf (Gbl.F.Out,"%s",Txt);
fprintf (Gbl.F.Out,"</div>");
}

View File

@ -130,10 +130,10 @@ void Lay_StartTableWide (unsigned CellPadding);
void Lay_StartTableWideMargin (unsigned CellPadding);
void Lay_EndTable (void);
void Lay_ShowErrorAndExit (const char *Message);
void Lay_ShowErrorAndExit (const char *Txt);
void Lay_ShowPendingAlert (void);
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message);
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message);
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Txt);
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Txt);
void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,
void (*FuncParams) (),
Lay_Button_t Button,const char *TxtButton);

View File

@ -462,9 +462,9 @@ void Lnk_RemoveLink (void)
DB_QueryDELETE (Query,"can not remove an institutional link");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Link_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Link_X_removed,
Lnk.ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Lnk_EditLinks ();
@ -536,9 +536,9 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewLnkName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_link_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_link_X_empty,
CurrentLnkName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -548,9 +548,9 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If link was in database... *****/
if (Lnk_CheckIfLinkNameExists (ParamName,NewLnkName,Lnk->LnkCod))
{
sprintf (Gbl.Message,Txt_The_link_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists,
NewLnkName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -558,16 +558,16 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
Lnk_UpdateLnkNameDB (Lnk->LnkCod,FieldName,NewLnkName);
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_link_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_link_X_has_been_renamed_as_Y,
CurrentLnkName,NewLnkName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_link_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_link_X_has_not_changed,
CurrentLnkName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -636,9 +636,9 @@ void Lnk_ChangeLinkWWW (void)
DB_QueryUPDATE (Query,"can not update the web of an institutional link");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,
NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
@ -771,15 +771,15 @@ void Lnk_RecFormNewLink (void)
/***** If name of link was in database... *****/
if (Lnk_CheckIfLinkNameExists ("ShortName",Lnk->ShrtName,-1L))
{
sprintf (Gbl.Message,Txt_The_link_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists,
Lnk->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Lnk_CheckIfLinkNameExists ("FullName",Lnk->FullName,-1L))
{
sprintf (Gbl.Message,Txt_The_link_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists,
Lnk->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (!Lnk->WWW[0])
Lay_ShowAlert (Lay_WARNING,Txt_You_must_specify_the_URL_of_the_new_link);
@ -814,7 +814,7 @@ static void Lnk_CreateLink (struct Link *Lnk)
DB_QueryINSERT (Query,"can not create institutional link");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_link_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_link_X,
Lnk->ShrtName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -286,9 +286,9 @@ void Log_RequestLogo (Sco_Scope_t Scope)
Lay_StartRoundFrame (NULL,Txt_Logo,NULL,NULL);
/***** Write help message *****/
sprintf (Gbl.Message,Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y,
sprintf (Gbl.Alert.Txt,Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y,
64,64);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Upload logo *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -375,8 +375,8 @@ void Log_ReceiveLogo (Sco_Scope_t Scope)
WrongType = true;
if (WrongType)
{
sprintf (Gbl.Message,Txt_The_file_is_not_X,"png");
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"png");
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{

View File

@ -370,13 +370,13 @@ void Mai_WriteWarningEmailNotifications (void)
Tab_Tab_t TabMyAccount = Act_Actions[SuperActionMyAccount ].Tab;
Tab_Tab_t TabMailDomains = Act_Actions[SuperActionMailDomains].Tab;
sprintf (Gbl.Message,Txt_You_can_only_receive_email_notifications_if_,
sprintf (Gbl.Alert.Txt,Txt_You_can_only_receive_email_notifications_if_,
Txt_TABS_TXT[TabMyAccount ],
Txt_MENU_TITLE[TabMyAccount ][Act_Actions[SuperActionMyAccount ].IndexInMenu],
Txt_TABS_TXT[TabMailDomains],
Txt_MENU_TITLE[TabMailDomains][Act_Actions[SuperActionMailDomains].IndexInMenu],
Txt_Domains);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -551,9 +551,9 @@ void Mai_RemoveMailDomain (void)
DB_QueryDELETE (Query,"can not remove a mail domain");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Email_domain_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Email_domain_X_removed,
Mai.Domain);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Mai_EditMailDomains ();
@ -625,9 +625,9 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewMaiName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty,
CurrentMaiName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -637,9 +637,9 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If mail was in database... *****/
if (Mai_CheckIfMailDomainNameExists (ParamName,NewMaiName,Mai->MaiCod))
{
sprintf (Gbl.Message,Txt_The_email_domain_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists,
NewMaiName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -647,16 +647,16 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
Mai_UpdateMailDomainNameDB (Mai->MaiCod,FieldName,NewMaiName);
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_email_domain_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_has_been_renamed_as_Y,
CurrentMaiName,NewMaiName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_email_domain_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_has_not_changed,
CurrentMaiName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -809,15 +809,15 @@ void Mai_RecFormNewMailDomain (void)
/***** If name of mail was in database... *****/
if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L))
{
sprintf (Gbl.Message,Txt_The_email_domain_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists,
Mai->Domain);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L))
{
sprintf (Gbl.Message,Txt_The_email_domain_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists,
Mai->Info);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new mail to database
Mai_CreateMailDomain (Mai);
@ -849,9 +849,9 @@ static void Mai_CreateMailDomain (struct Mail *Mai)
DB_QueryINSERT (Query,"can not create mail domain");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_email_domain_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_email_domain_X,
Mai->Domain);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -1386,8 +1386,8 @@ static void Mai_RemoveEmail (struct UsrData *UsrDat)
Mai_RemoveEmailFromDB (UsrDat->UsrCod,Email);
/***** Show message *****/
sprintf (Gbl.Message,Txt_Email_X_removed,Email);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Email_X_removed,Email);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Update list of emails *****/
Mai_GetEmailFromUsrCod (UsrDat);
@ -1471,18 +1471,18 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
if (UsrDat->EmailConfirmed &&
!strcmp (UsrDat->Email,NewEmail)) // User's current confirmed email match exactly the new email
{
sprintf (Gbl.Message,Txt_The_email_address_X_matches_one_previously_registered,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_matches_one_previously_registered,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
if (Mai_UpdateEmailInDB (UsrDat,NewEmail))
{
/***** Email updated sucessfully *****/
sprintf (Gbl.Message,Txt_The_email_address_X_has_been_registered_successfully,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_has_been_registered_successfully,
NewEmail);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Update list of emails *****/
Mai_GetEmailFromUsrCod (UsrDat);
@ -1494,17 +1494,17 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
}
else
{
sprintf (Gbl.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
}
else // New email is not valid
{
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else
@ -1641,10 +1641,10 @@ bool Mai_SendMailMsgToConfirmEmail (void)
Lay_ShowAlert (Lay_WARNING,Txt_There_was_a_problem_sending_an_email_automatically);
return false;
default:
sprintf (Gbl.Message,"Internal error: an email message has not been sent successfully."
sprintf (Gbl.Alert.Txt,"Internal error: an email message has not been sent successfully."
" Error code returned by the script: %d",
ReturnCode);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
return false;
}
}
@ -1657,9 +1657,9 @@ void Mai_ShowMsgConfirmEmailHasBeenSent (void)
{
extern const char *Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address;
sprintf (Gbl.Message,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
sprintf (Gbl.Alert.Txt,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
Gbl.Usrs.Me.UsrDat.Email);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -1753,7 +1753,7 @@ void Mai_ConfirmEmail (void)
/***** Confirm email *****/
if (Confirmed)
sprintf (Gbl.Message,Txt_Email_X_has_already_been_confirmed_before,
sprintf (Gbl.Alert.Txt,Txt_Email_X_has_already_been_confirmed_before,
Email);
else
{
@ -1763,9 +1763,9 @@ void Mai_ConfirmEmail (void)
UsrCod,Email);
DB_QueryUPDATE (Query,"can not confirm email");
sprintf (Gbl.Message,Txt_The_email_X_has_been_confirmed,Email);
sprintf (Gbl.Alert.Txt,Txt_The_email_X_has_been_confirmed,Email);
}
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_The_email_address_has_not_been_confirmed);

View File

@ -279,9 +279,9 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
DB_QueryUPDATE (Query,"can not update properties of marks");
/***** Write message of success *****/
sprintf (Gbl.Message,Txt_The_number_of_rows_is_now_X,
sprintf (Gbl.Alert.Txt,Txt_The_number_of_rows_is_now_X,
NumRows);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowErrorAndExit ("Wrong number of rows.");
@ -295,7 +295,7 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
/*****************************************************************************/
// Returns true if the format of the HTML file of marks is correct
// Returns true if the format of the HTML file of marks is wrong
// Gbl.Message will contain feedback text
// Gbl.Alert.Txt will contain feedback text
bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks)
{
@ -323,7 +323,7 @@ bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks)
// Only one table is allowed
if (Str_FindStrInFile (FileAllMarks,"<table",Str_NO_SKIP_HTML_COMMENTS))
{
sprintf (Gbl.Message,"%s",Txt_There_are_more_than_one_table_in_the_file_of_marks);
sprintf (Gbl.Alert.Txt,"%s",Txt_There_are_more_than_one_table_in_the_file_of_marks);
FileIsCorrect = false;
}
else
@ -384,7 +384,7 @@ bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks)
}
else
{
sprintf (Gbl.Message,"%s",Txt_Table_not_found_in_the_file_of_marks);
sprintf (Gbl.Alert.Txt,"%s",Txt_Table_not_found_in_the_file_of_marks);
FileIsCorrect = false;
}
@ -393,7 +393,7 @@ bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks)
}
/*
if (FileIsCorrect)
sprintf (Gbl.Message,Txt_X_header_rows_Y_student_rows_and_Z_footer_rows_found,
sprintf (Gbl.Alert.Txt,Txt_X_header_rows_Y_student_rows_and_Z_footer_rows_found,
Marks->Header,NumRowsStds,Marks->Footer);
*/
@ -456,7 +456,7 @@ static bool Mrk_GetUsrMarks (FILE *FileUsrMarks,struct UsrData *UsrDat,
/***** Open HTML file with the table of marks *****/
if (!(FileAllMarks = fopen (PathFileAllMarks,"rb")))
{ // Can't open the file with the table of marks
sprintf (Gbl.Message,"%s","Can not open file of marks."); // TODO: Need translation!
sprintf (Gbl.Alert.Txt,"%s","Can not open file of marks."); // TODO: Need translation!
return false;
}
@ -591,7 +591,7 @@ static bool Mrk_GetUsrMarks (FILE *FileUsrMarks,struct UsrData *UsrDat,
/***** User's ID not found in table *****/
fclose (FileAllMarks);
sprintf (Gbl.Message,Txt_THE_USER_X_is_not_found_in_the_file_of_marks,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_found_in_the_file_of_marks,
UsrDat->FullName);
return false;
}
@ -701,7 +701,7 @@ void Mrk_ShowMyMarks (void)
else // Problems in table of marks or user's ID not found
{
fclose (FileUsrMarks);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
unlink (FileNameUsrMarks); // File with marks is no longer necessary
@ -856,23 +856,23 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
else
{
fclose (FileUsrMarks);
if ((*ContentStr = (char *) malloc (9 + strlen (Gbl.Message) + 3 + 1)))
sprintf (*ContentStr,"<![CDATA[%s]]>",Gbl.Message);
if ((*ContentStr = (char *) malloc (9 + strlen (Gbl.Alert.Txt) + 3 + 1)))
sprintf (*ContentStr,"<![CDATA[%s]]>",Gbl.Alert.Txt);
}
}
else
{
sprintf (Gbl.Message,"%s","Can not open file with user's marks!"); // TODO: Need translation!
if ((*ContentStr = (char *) malloc (9 + strlen (Gbl.Message) + 3 + 1)))
sprintf (*ContentStr,"<![CDATA[%s]]>",Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s","Can not open file with user's marks!"); // TODO: Need translation!
if ((*ContentStr = (char *) malloc (9 + strlen (Gbl.Alert.Txt) + 3 + 1)))
sprintf (*ContentStr,"<![CDATA[%s]]>",Gbl.Alert.Txt);
}
unlink (FileNameUsrMarks); // File with marks is no longer necessary
}
else
{
sprintf (Gbl.Message,"%s","User's IDs not found!"); // TODO: Need translation!
if ((*ContentStr = (char *) malloc (9 + strlen (Gbl.Message) + 3 + 1)))
sprintf (*ContentStr,"<![CDATA[%s]]>",Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s","User's IDs not found!"); // TODO: Need translation!
if ((*ContentStr = (char *) malloc (9 + strlen (Gbl.Alert.Txt) + 3 + 1)))
sprintf (*ContentStr,"<![CDATA[%s]]>",Gbl.Alert.Txt);
}
}
}

View File

@ -735,8 +735,8 @@ void Msg_RecMsgFromUsr (void)
if (RecipientHasBannedMe)
{
/***** Show an alert indicating that the message has not been sent successfully *****/
sprintf (Gbl.Message,Txt_message_not_sent_to_X,UsrDstData.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_message_not_sent_to_X,UsrDstData.FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -771,10 +771,10 @@ void Msg_RecMsgFromUsr (void)
0));
/***** Show an alert indicating that the message has been sent successfully *****/
sprintf (Gbl.Message,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
sprintf (Gbl.Alert.Txt,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
Txt_message_sent_to_X_not_notified_by_email,
UsrDstData.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Increment number of recipients *****/
if (NotifyByEmail)
@ -811,9 +811,9 @@ void Msg_RecMsgFromUsr (void)
Lay_ShowAlert (Lay_SUCCESS,Txt_The_message_has_been_sent_to_1_recipient);
else
{
sprintf (Gbl.Message,Txt_The_message_has_been_sent_to_X_recipients,
sprintf (Gbl.Alert.Txt,Txt_The_message_has_been_sent_to_X_recipients,
(unsigned) NumRecipients);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show message about number of users to be notified *****/
@ -826,9 +826,9 @@ void Msg_RecMsgFromUsr (void)
/***** Show alert about errors on sending message *****/
if (NumErrors > 1)
{
sprintf (Gbl.Message,Txt_There_have_been_X_errors_in_sending_the_message,
sprintf (Gbl.Alert.Txt,Txt_There_have_been_X_errors_in_sending_the_message,
(unsigned) NumErrors);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
}
@ -856,12 +856,12 @@ void Msg_ReqDelAllRecMsgs (void)
if (Gbl.Msg.FilterContent[0])
{
if (Gbl.Msg.ShowOnlyUnreadMsgs)
sprintf (Gbl.Message,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
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,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
else
sprintf (Gbl.Message,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
@ -869,17 +869,17 @@ void Msg_ReqDelAllRecMsgs (void)
else
{
if (Gbl.Msg.ShowOnlyUnreadMsgs)
sprintf (Gbl.Message,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
else
sprintf (Gbl.Message,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
}
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show received messages again */
Gbl.Msg.TypeOfMessages = Msg_MESSAGES_RECEIVED;
@ -910,16 +910,16 @@ void Msg_ReqDelAllSntMsgs (void)
/***** Show question and button to remove messages received *****/
/* Start alert */
if (Gbl.Msg.FilterContent[0])
sprintf (Gbl.Message,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
else
sprintf (Gbl.Message,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show sent messages again */
Gbl.Msg.TypeOfMessages = Msg_MESSAGES_SENT;
@ -987,9 +987,9 @@ static void Msg_ShowNumMsgsDeleted (unsigned NumMsgs)
Lay_ShowAlert (Lay_SUCCESS,Txt_One_message_has_been_deleted);
else
{
sprintf (Gbl.Message,Txt_X_messages_have_been_deleted,
sprintf (Gbl.Alert.Txt,Txt_X_messages_have_been_deleted,
NumMsgs);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -3640,9 +3640,9 @@ void Msg_BanSenderWhenShowingMsgs (void)
DB_QueryREPLACE (Query,"can not ban sender");
/***** Show alert with the change made *****/
sprintf (Gbl.Message,Txt_From_this_time_you_will_not_receive_messages_from_X,
sprintf (Gbl.Alert.Txt,Txt_From_this_time_you_will_not_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/**** Show received messages again */
Msg_ShowRecMsgs ();
@ -3697,9 +3697,9 @@ static void Msg_UnbanSender (void)
DB_QueryDELETE (Query,"can not ban sender");
/***** Show alert with the change made *****/
sprintf (Gbl.Message,Txt_From_this_time_you_can_receive_messages_from_X,
sprintf (Gbl.Alert.Txt,Txt_From_this_time_you_can_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -317,8 +317,8 @@ void Nck_RemoveNick (void)
Nck_RemoveNicknameFromDB (NicknameWithoutArroba);
/***** Show message *****/
sprintf (Gbl.Message,Txt_Nickname_X_removed,NicknameWithoutArroba);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Nickname_X_removed,NicknameWithoutArroba);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_delete_your_current_nickname);
@ -370,7 +370,7 @@ void Nck_UpdateNick (void)
if (!strcmp (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba)) // My nickname match exactly the new nickname
{
Error = true;
sprintf (Gbl.Message,Txt_The_nickname_X_matches_the_one_you_had_previously_registered,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_matches_the_one_you_had_previously_registered,
NewNicknameWithoutArroba);
}
else if (strcasecmp (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba)) // My nickname does not match, not even case insensitive, the new nickname
@ -388,7 +388,7 @@ void Nck_UpdateNick (void)
if (DB_QueryCOUNT (Query,"can not check if nickname already existed")) // A nickname of another user is the same that my nickname
{
Error = true;
sprintf (Gbl.Message,Txt_The_nickname_X_had_been_registered_by_another_user,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
}
}
@ -400,14 +400,14 @@ void Nck_UpdateNick (void)
Str_Copy (Gbl.Usrs.Me.UsrDat.Nickname,NewNicknameWithoutArroba,
Nck_MAX_BYTES_NICKNAME_WITHOUT_ARROBA);
sprintf (Gbl.Message,Txt_Your_nickname_X_has_been_registered_successfully,
sprintf (Gbl.Alert.Txt,Txt_Your_nickname_X_has_been_registered_successfully,
NewNicknameWithoutArroba);
}
}
else // New nickname is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_nickname_entered_X_is_not_valid_,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_,
NewNicknameWithArroba,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
@ -416,7 +416,7 @@ void Nck_UpdateNick (void)
/***** Show message *****/
Lay_ShowAlert (Error ? Lay_WARNING :
Lay_SUCCESS,
Gbl.Message);
Gbl.Alert.Txt);
/***** Show my account again *****/
Acc_ShowFormChangeMyAccount ();

View File

@ -94,9 +94,9 @@ void Not_ShowFormNotice (void)
extern const char *Txt_Create_notice;
/***** Help message *****/
sprintf (Gbl.Message,Txt_The_notice_will_appear_as_a_yellow_note_,
sprintf (Gbl.Alert.Txt,Txt_The_notice_will_appear_as_a_yellow_note_,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
/***** Start form *****/
Act_FormStart (ActRcvNot);

View File

@ -1794,9 +1794,9 @@ void Ntf_ShowAlertNumUsrsToBeNotifiedByEMail (unsigned NumUsrsToBeNotifiedByEMai
{
extern const char *Txt_No_of_users_who_will_be_notified_by_email;
sprintf (Gbl.Message,"%s: %u",
sprintf (Gbl.Alert.Txt,"%s: %u",
Txt_No_of_users_who_will_be_notified_by_email,NumUsrsToBeNotifiedByEMail);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

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

View File

@ -180,7 +180,7 @@ void Pwd_ActChgMyPwd1 (void)
/***** Check if I have written twice the same password *****/
if (strcmp (NewPlainPassword[0],NewPlainPassword[1]))
// Passwords don't match
sprintf (Gbl.Message,"%s",Txt_You_have_not_written_twice_the_same_new_password);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_have_not_written_twice_the_same_new_password);
else
{
Cry_EncryptSHA512Base64 (NewPlainPassword[0],NewEncryptedPassword);
@ -193,13 +193,13 @@ void Pwd_ActChgMyPwd1 (void)
Ses_UpdateSessionDataInDB ();
Enr_UpdateUsrData (&Gbl.Usrs.Me.UsrDat);
sprintf (Gbl.Message,"%s",Txt_Your_password_has_been_changed_successfully);
sprintf (Gbl.Alert.Txt,"%s",Txt_Your_password_has_been_changed_successfully);
Gbl.Usrs.Error = false;
}
}
}
else
sprintf (Gbl.Message,"%s",Txt_You_have_not_entered_your_password_correctly);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_have_not_entered_your_password_correctly);
}
void Pwd_ActChgMyPwd2 (void)
@ -207,7 +207,7 @@ void Pwd_ActChgMyPwd2 (void)
/***** Write error message when updating password *****/
Lay_ShowAlert (Gbl.Usrs.Error ? Lay_WARNING :
Lay_INFO,
Gbl.Message);
Gbl.Alert.Txt);
/***** Retry? *****/
if (Gbl.Usrs.Error)
@ -359,10 +359,10 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
Lay_ShowAlert (Lay_WARNING,Txt_There_was_a_problem_sending_an_email_automatically);
break;
default:
sprintf (Gbl.Message,"Internal error: an email message has not been sent successfully."
sprintf (Gbl.Alert.Txt,"Internal error: an email message has not been sent successfully."
" Error code returned by the script: %d",
ReturnCode);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
break;
}
else // I have no email address
@ -373,9 +373,9 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
{
/***** Help message *****/
// TODO: This message allows to know if a ID exists in database (when no unique). This should be hidden!
sprintf (Gbl.Message,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
Gbl.Usrs.Me.UsrIdLogin);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
Pwd_ShowFormSendNewPwd ();
}
@ -503,7 +503,7 @@ void Pwd_UpdateOtherPwd1 (void)
if (strcmp (NewPlainPassword[0],NewPlainPassword[1]))
// Paswords don't match
sprintf (Gbl.Message,"%s",Txt_You_have_not_written_twice_the_same_new_password);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_have_not_written_twice_the_same_new_password);
else
{
Cry_EncryptSHA512Base64 (NewPlainPassword[0],NewEncryptedPassword);
@ -515,26 +515,26 @@ void Pwd_UpdateOtherPwd1 (void)
Pwd_BYTES_ENCRYPTED_PASSWORD);
Enr_UpdateUsrData (&Gbl.Usrs.Other.UsrDat);
sprintf (Gbl.Message,Txt_The_X_password_has_been_changed_successfully,
sprintf (Gbl.Alert.Txt,Txt_The_X_password_has_been_changed_successfully,
Gbl.Usrs.Other.UsrDat.FullName);
Gbl.Usrs.Error = false;
}
}
}
else
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
else // User not found
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
void Pwd_UpdateOtherPwd2 (void)
{
/***** Write message when updating the password *****/
if (Gbl.Message[0])
if (Gbl.Alert.Txt[0])
Lay_ShowAlert (Gbl.Usrs.Error ? Lay_WARNING :
Lay_INFO,
Gbl.Message);
Gbl.Alert.Txt);
if (Gbl.Usrs.Error)
{
@ -561,7 +561,7 @@ bool Pwd_SlowCheckIfPasswordIsGood (const char *PlainPassword,
/***** Check if password is found in user's ID, first name or surnames of anybody *****/
if (Pwd_CheckIfPasswdIsUsrIDorName (PlainPassword)) // PlainPassword is a user's ID, name or surname
{
sprintf (Gbl.Message,"%s",Txt_The_password_is_too_trivial_);
sprintf (Gbl.Alert.Txt,"%s",Txt_The_password_is_too_trivial_);
return false;
}
@ -569,7 +569,7 @@ bool Pwd_SlowCheckIfPasswordIsGood (const char *PlainPassword,
if (Pwd_GetNumOtherUsrsWhoUseThisPassword (EncryptedPassword,UsrCod) >
Pwd_MAX_OTHER_USERS_USING_THE_SAME_PASSWORD)
{
sprintf (Gbl.Message,"%s",Txt_The_password_is_too_trivial_);
sprintf (Gbl.Alert.Txt,"%s",Txt_The_password_is_too_trivial_);
return false;
}
@ -638,7 +638,7 @@ bool Pwd_FastCheckIfPasswordSeemsGood (const char *PlainPassword)
/***** Check length of password *****/
if (LengthPassword < Pwd_MIN_BYTES_PLAIN_PASSWORD) // PlainPassword too short
{
sprintf (Gbl.Message,Txt_The_password_must_be_at_least_X_characters,
sprintf (Gbl.Alert.Txt,Txt_The_password_must_be_at_least_X_characters,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
return false;
}
@ -646,7 +646,7 @@ bool Pwd_FastCheckIfPasswordSeemsGood (const char *PlainPassword)
/***** Check spaces in password *****/
if (strchr (PlainPassword,(int) ' ') != NULL) // PlainPassword with spaces
{
sprintf (Gbl.Message,"%s",Txt_The_password_can_not_contain_spaces);
sprintf (Gbl.Alert.Txt,"%s",Txt_The_password_can_not_contain_spaces);
return false;
}
@ -658,7 +658,7 @@ bool Pwd_FastCheckIfPasswordSeemsGood (const char *PlainPassword)
ItsANumber = false;
if (ItsANumber)
{
sprintf (Gbl.Message,"%s",Txt_The_password_can_not_consist_only_of_digits);
sprintf (Gbl.Alert.Txt,"%s",Txt_The_password_can_not_consist_only_of_digits);
return false;
}
@ -717,9 +717,9 @@ void Pwd_ShowFormChgPwd (void)
/* Help message */
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">");
sprintf (Gbl.Message,Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
sprintf (Gbl.Alert.Txt,Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -745,7 +745,7 @@ void Pwd_PutFormToGetNewPasswordOnce (void)
extern const char *Txt_Password;
extern const char *Txt_HELP_password;
sprintf (Gbl.Message,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
sprintf (Gbl.Alert.Txt,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">"
"<label for=\"Passwd\" class=\"%s\">%s:</label>"
@ -759,7 +759,7 @@ void Pwd_PutFormToGetNewPasswordOnce (void)
The_ClassForm[Gbl.Prefs.Theme],
Txt_Password,
Pwd_MAX_CHARS_PLAIN_PASSWORD,
Gbl.Message);
Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -773,7 +773,7 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
extern const char *Txt_HELP_password;
extern const char *Txt_Retype_new_password;
sprintf (Gbl.Message,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
sprintf (Gbl.Alert.Txt,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">"
"<label for=\"Paswd1\" class=\"%s\">%s:</label>"
@ -797,11 +797,11 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
The_ClassForm[Gbl.Prefs.Theme],
Txt_New_password,
Pwd_MAX_CHARS_PLAIN_PASSWORD,
Gbl.Message,
Gbl.Alert.Txt,
The_ClassForm[Gbl.Prefs.Theme],
Txt_Retype_new_password,
Pwd_MAX_CHARS_PLAIN_PASSWORD,
Gbl.Message);
Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -475,9 +475,9 @@ void Pho_ReqRemoveUsrPhoto (void)
{
/***** Show question and button to remove user's photo *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_photo_of_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_photo_of_X,
Gbl.Usrs.Other.UsrDat.FullName);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* Show current photo */
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
@ -602,8 +602,8 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
WrongType = true;
if (WrongType)
{
sprintf (Gbl.Message,Txt_The_file_is_not_X,"jpg");
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"jpg");
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
return false;
}
@ -670,10 +670,10 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
NumFacesTotal = NumFacesGreen = NumFacesRed = 0;
break;
default: // Error
sprintf (Gbl.Message,"Photo could not be processed successfully.<br />"
sprintf (Gbl.Alert.Txt,"Photo could not be processed successfully.<br />"
"Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
break;
}
@ -691,25 +691,25 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
{
if (NumFacesRed == 0)
{
sprintf (Gbl.Message,Txt_X_faces_marked_in_green_have_been_detected_,
sprintf (Gbl.Alert.Txt,Txt_X_faces_marked_in_green_have_been_detected_,
NumFacesGreen);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else if (NumFacesGreen == 0)
{
sprintf (Gbl.Message,Txt_X_faces_marked_in_red_have_been_detected_,
sprintf (Gbl.Alert.Txt,Txt_X_faces_marked_in_red_have_been_detected_,
NumFacesRed);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // NumFacesGreen > 0
{
if (NumFacesGreen == 1)
sprintf (Gbl.Message,Txt_X_faces_have_been_detected_in_front_position_1_Z_,
sprintf (Gbl.Alert.Txt,Txt_X_faces_have_been_detected_in_front_position_1_Z_,
NumFacesTotal,NumFacesRed);
else
sprintf (Gbl.Message,Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
sprintf (Gbl.Alert.Txt,Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
NumFacesTotal,NumFacesGreen,NumFacesRed);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -821,13 +821,13 @@ static void Pho_UpdatePhoto1 (struct UsrData *UsrDat)
/* Remove the user from the list of users without photo */
Pho_RemoveUsrFromTableClicksWithoutPhoto (UsrDat->UsrCod);
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,"%s",Txt_Photo_has_been_updated);
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,"%s",Txt_Photo_has_been_updated);
}
else
{
Gbl.AlertType = Lay_ERROR;
sprintf (Gbl.Message,"%s","Error updating photo.");
Gbl.Alert.Type = Lay_ERROR;
sprintf (Gbl.Alert.Txt,"%s","Error updating photo.");
}
}
@ -1049,14 +1049,14 @@ bool Pho_RemovePhoto (struct UsrData *UsrDat)
if (NumErrors)
{
Gbl.AlertType = Lay_ERROR;
sprintf (Gbl.Message,"%s","Error removing photo.");
Gbl.Alert.Type = Lay_ERROR;
sprintf (Gbl.Alert.Txt,"%s","Error removing photo.");
return false;
}
else
{
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,"%s",Txt_Photo_removed);
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,"%s",Txt_Photo_removed);
return true;
}
}

View File

@ -576,9 +576,9 @@ void Plc_RemovePlace (void)
DB_QueryDELETE (Query,"can not remove a place");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Place_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Place_X_removed,
Plc.FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -651,9 +651,9 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewPlcName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_place_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_place_X_empty,
CurrentPlcName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -663,9 +663,9 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If place was in database... *****/
if (Plc_CheckIfPlaceNameExists (ParamName,NewPlcName,Plc->PlcCod))
{
sprintf (Gbl.Message,Txt_The_place_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists,
NewPlcName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -673,16 +673,16 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
Plc_UpdatePlcNameDB (Plc->PlcCod,FieldName,NewPlcName);
/* Write message to show the change made */
sprintf (Gbl.Message,Txt_The_place_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_place_X_has_been_renamed_as_Y,
CurrentPlcName,NewPlcName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_place_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_place_X_has_not_changed,
CurrentPlcName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -837,15 +837,15 @@ void Plc_RecFormNewPlace (void)
/***** If name of place was in database... *****/
if (Plc_CheckIfPlaceNameExists ("ShortName",Plc->ShrtName,-1L))
{
sprintf (Gbl.Message,Txt_The_place_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists,
Plc->ShrtName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else if (Plc_CheckIfPlaceNameExists ("FullName",Plc->FullName,-1L))
{
sprintf (Gbl.Message,Txt_The_place_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists,
Plc->FullName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new place to database
Plc_CreatePlace (Plc);
@ -877,7 +877,7 @@ static void Plc_CreatePlace (struct Place *Plc)
DB_QueryINSERT (Query,"can not create place");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_place_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_place_X,
Plc->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -497,9 +497,9 @@ void Plg_RemovePlugin (void)
DB_QueryDELETE (Query,"can not remove a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Plugin_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Plugin_X_removed,
Plg.Name);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Plg_EditPlugins ();
@ -535,9 +535,9 @@ void Plg_RenamePlugin (void)
/***** Check if new name is empty *****/
if (!NewPlgName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
Plg->Name);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -547,9 +547,9 @@ void Plg_RenamePlugin (void)
/***** If plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (NewPlgName,Plg->PlgCod))
{
sprintf (Gbl.Message,Txt_The_plugin_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_already_exists,
NewPlgName);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -559,16 +559,16 @@ void Plg_RenamePlugin (void)
DB_QueryUPDATE (Query,"can not update the name of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_plugin_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_has_been_renamed_as_Y,
Plg->Name,NewPlgName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_plugin_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_plugin_X_has_not_changed,
Plg->Name);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -624,14 +624,14 @@ void Plg_ChangePlgDescription (void)
DB_QueryUPDATE (Query,"can not update the description of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_description_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_description_is_X,
NewDescription);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{
sprintf (Gbl.Message,"%s",Txt_You_can_not_leave_the_description_empty);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_You_can_not_leave_the_description_empty);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -671,9 +671,9 @@ void Plg_ChangePlgLogo (void)
DB_QueryUPDATE (Query,"can not update the logo of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_logo_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_logo_is_X,
NewLogo);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_logo_empty);
@ -715,9 +715,9 @@ void Plg_ChangePlgAppKey (void)
DB_QueryUPDATE (Query,"can not update the application key of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sprintf (Gbl.Alert.Txt,Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NewAppKey);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_logo_empty); // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -759,9 +759,9 @@ void Plg_ChangePlgURL (void)
DB_QueryUPDATE (Query,"can not update the URL of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_URL_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_URL_is_X,
NewURL);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_URL_empty);
@ -803,9 +803,9 @@ void Plg_ChangePlgIP (void)
DB_QueryUPDATE (Query,"can not update the IP address of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_IP_address_is_X,
sprintf (Gbl.Alert.Txt,Txt_The_new_IP_address_is_X,
NewIP);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_IP_address_empty);
@ -1011,9 +1011,9 @@ void Plg_RecFormNewPlg (void)
/***** If name of plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (Plg->Name,-1L))
{
sprintf (Gbl.Message,Txt_The_plugin_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_already_exists,
Plg->Name);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // Add new plugin to database
Plg_CreatePlugin (Plg);
@ -1051,9 +1051,9 @@ static void Plg_CreatePlugin (struct Plugin *Plg)
DB_QueryINSERT (Query,"can not create plugin");
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_plugin_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_plugin_X,
Plg->Name);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/

View File

@ -188,9 +188,9 @@ void Rec_ReqEditRecordFields (void)
}
else // No fields of records found for current course in the database
{
sprintf (Gbl.Message,Txt_There_are_no_record_fields_in_the_course_X,
sprintf (Gbl.Alert.Txt,Txt_There_are_no_record_fields_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
/***** Put a form to create a new record field *****/
@ -468,9 +468,9 @@ void Rec_ReceiveFormField (void)
/***** If the field already was in the database... *****/
if (Rec_CheckIfRecordFieldIsRepeated (Gbl.CurrentCrs.Records.Field.Name))
{
sprintf (Gbl.Message,Txt_The_record_field_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_already_exists,
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
else // Add the new field to the database
Rec_CreateRecordField ();
@ -572,9 +572,9 @@ void Rec_CreateRecordField (void)
DB_QueryINSERT (Query,"can not create field of record");
/***** Write message of success *****/
sprintf (Gbl.Message,Txt_Created_new_record_field_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_record_field_X,
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -642,19 +642,19 @@ void Rec_AskConfirmRemFieldWithRecords (unsigned NumRecords)
/***** Show question and button to remove my photo *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_X,
sprintf (Gbl.Alert.Txt,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)
Str_Concat (Gbl.Message,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,
Lay_MAX_BYTES_ALERT);
else
{
sprintf (Message_part2,Txt_this_field_is_filled_in_the_records_of_X_students,
NumRecords);
Str_Concat (Gbl.Message,Message_part2,
Str_Concat (Gbl.Alert.Txt,Message_part2,
Lay_MAX_BYTES_ALERT);
}
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Lay_ShowAlertAndButton2 (ActRemFie,NULL,Rec_PutParamFielCod,
@ -690,9 +690,9 @@ void Rec_RemoveFieldFromDB (void)
DB_QueryDELETE (Query,"can not remove field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Record_field_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Record_field_X_removed,
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
Rec_ReqEditRecordFields ();
@ -796,9 +796,9 @@ void Rec_RenameField (void)
/***** Check if new name is empty *****/
if (!NewFieldName[0])
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_field_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_field_X_empty,
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
else
{
@ -809,9 +809,9 @@ void Rec_RenameField (void)
/***** If the group ya estaba in the database... *****/
if (Rec_CheckIfRecordFieldIsRepeated (NewFieldName))
{
sprintf (Gbl.Message,Txt_The_record_field_X_already_exists,
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_already_exists,
NewFieldName);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
else
{
@ -822,16 +822,16 @@ void Rec_RenameField (void)
DB_QueryUPDATE (Query,"can not update name of field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_record_field_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_has_been_renamed_as_Y,
Gbl.CurrentCrs.Records.Field.Name,NewFieldName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Message,Txt_The_name_of_the_field_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_field_X_has_not_changed,
NewFieldName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
}
@ -871,9 +871,9 @@ void Rec_ChangeLinesField (void)
(this happens when return is pressed without changes) *****/
if (Gbl.CurrentCrs.Records.Field.NumLines == NewNumLines)
{
sprintf (Gbl.Message,Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed,
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else
{
@ -884,9 +884,9 @@ void Rec_ChangeLinesField (void)
DB_QueryUPDATE (Query,"can not update the number of lines of a field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y,
sprintf (Gbl.Alert.Txt,Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y,
Gbl.CurrentCrs.Records.Field.Name,NewNumLines);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -924,9 +924,9 @@ void Rec_ChangeVisibilityField (void)
(this happens whe return is pressed without changes in the form) *****/
if (Gbl.CurrentCrs.Records.Field.Visibility == NewVisibility)
{
sprintf (Gbl.Message,Txt_The_visibility_of_the_record_field_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_visibility_of_the_record_field_X_has_not_changed,
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else
{
@ -937,9 +937,9 @@ void Rec_ChangeVisibilityField (void)
DB_QueryUPDATE (Query,"can not update the visibility of a field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility],
sprintf (Gbl.Alert.Txt,Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility],
Gbl.CurrentCrs.Records.Field.Name);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Show the form again *****/
@ -1640,7 +1640,7 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
long OriginalActCod;
/***** Initialize alert type and message *****/
Gbl.AlertType = Lay_NONE; // Do not show alert
Gbl.Alert.Type = Lay_NONE; // Do not show alert
/***** Get where we came from *****/
OriginalActCod = Par_GetParToLong ("OriginalActCod");
@ -1661,8 +1661,8 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
/***** Update the record *****/
Rec_UpdateCrsRecord (Gbl.Usrs.Other.UsrDat.UsrCod);
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,"%s",
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,"%s",
Txt_Student_record_card_in_this_course_has_been_updated);
/***** Show one or multiple records *****/
@ -1997,9 +1997,9 @@ void Rec_RemoveFieldsCrsRecordInCrs (long UsrCod,struct Course *Crs,Cns_QuietOrV
/***** Write mensaje *****/
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_User_record_card_in_the_course_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_User_record_card_in_the_course_X_has_been_removed,
Crs->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}

View File

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

View File

@ -1012,9 +1012,9 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM;
if (!ICanQueryWholeRange && NumDays > Cfg_DAYS_IN_RECENT_LOG)
{
sprintf (Gbl.Message,Txt_The_date_range_must_be_less_than_or_equal_to_X_days,
sprintf (Gbl.Alert.Txt,Txt_The_date_range_must_be_less_than_or_equal_to_X_days,
Cfg_DAYS_IN_RECENT_LOG);
Lay_ShowAlert (Lay_WARNING,Gbl.Message); // ...write warning message and show the form again
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); // ...write warning message and show the form again
return;
}

View File

@ -1035,8 +1035,8 @@ void Str_ChangeFormat (Str_ChangeFrom_t ChangeFrom,Str_ChangeTo_t ChangeTo,
/*
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
{
sprintf (Gbl.Message,"Str_ChangeFormat (&quot;%s&quot;)",Str);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
sprintf (Gbl.Alert.Txt,"Str_ChangeFormat (&quot;%s&quot;)",Str);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
*/
@ -2693,7 +2693,7 @@ int Str_ReadFileUntilBoundaryStr (FILE *FileSrc,char *StrDst,
/****** Convert invalid characters in a file name to valid characters ********/
/*****************************************************************************/
// Return true if the name of the file o folder is valid
// If the name is not valid, Gbl.Message will contain feedback text
// If the name is not valid, Gbl.Alert.Txt will contain feedback text
// File names with heading and trailing spaces are allowed
bool Str_ConvertFilFolLnkNameToValid (char *FileName)
@ -2784,13 +2784,13 @@ bool Str_ConvertFilFolLnkNameToValid (char *FileName)
if (NumAlfanum)
FileNameIsOK = true;
else
snprintf (Gbl.Message,Lay_MAX_BYTES_ALERT,
snprintf (Gbl.Alert.Txt,Lay_MAX_BYTES_ALERT,
Gbl.FileBrowser.UploadingWithDropzone ? Txt_UPLOAD_FILE_X_invalid_name_NO_HTML :
Txt_UPLOAD_FILE_X_invalid_name,
FileName);
}
else // FileName is empty
sprintf (Gbl.Message,"%s",
sprintf (Gbl.Alert.Txt,"%s",
Gbl.FileBrowser.UploadingWithDropzone ? Txt_UPLOAD_FILE_Invalid_name_NO_HTML :
Txt_UPLOAD_FILE_Invalid_name);
@ -2876,9 +2876,9 @@ void Str_Copy (char *Dst,const char *Src,size_t DstSize)
/***** Check if buffer has enough space for source *****/
if (LengthSrc > DstSize)
{
sprintf (Gbl.Message,"Trying to copy %lu chars into a %lu-chars buffer.",
sprintf (Gbl.Alert.Txt,"Trying to copy %lu chars into a %lu-chars buffer.",
LengthSrc,DstSize);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
/***** Copy source into destination *****/
@ -2899,9 +2899,9 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize)
LengthDst = strlen (Dst);
if (LengthDst > DstSize)
{
sprintf (Gbl.Message,"%lu-chars buffer has %lu chars!",
sprintf (Gbl.Alert.Txt,"%lu-chars buffer has %lu chars!",
DstSize,LengthDst);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
/***** Check if buffer has enough space for source *****/
@ -2910,9 +2910,9 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize)
LengthSrc = strlen (Src);
if (FreeSpace < LengthSrc)
{
sprintf (Gbl.Message,"Trying to concatenate %lu chars to a %lu-chars buffer with free space for only %lu chars!",
sprintf (Gbl.Alert.Txt,"Trying to concatenate %lu chars to a %lu-chars buffer with free space for only %lu chars!",
LengthSrc,DstSize,FreeSpace);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
/***** Concatenate ******/

View File

@ -1479,9 +1479,9 @@ void Svy_AskRemSurvey (void)
/***** Show question and button to remove survey *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_survey_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_survey_X,
Svy.Title);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Gbl.Svys.SvyCodToEdit = Svy.SvyCod;
@ -1542,9 +1542,9 @@ void Svy_RemoveSurvey (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_SURVEY,Svy.SvyCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Survey_X_removed,
sprintf (Gbl.Alert.Txt,Txt_Survey_X_removed,
Svy.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/
Svy_ListAllSurveys (&SvyQst);
@ -1575,9 +1575,9 @@ void Svy_AskResetSurvey (void)
Lay_ShowErrorAndExit ("You can not reset this survey.");
/***** Ask for confirmation of reset *****/
sprintf (Gbl.Message,Txt_Do_you_really_want_to_reset_the_survey_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reset_the_survey_X,
Svy.Title);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
/***** Button of confirmation of reset *****/
Gbl.Svys.SvyCodToEdit = Svy.SvyCod;
@ -1634,9 +1634,9 @@ void Svy_ResetSurvey (void)
DB_QueryUPDATE (Query,"can not reset answers of a survey");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Survey_X_reset,
sprintf (Gbl.Alert.Txt,Txt_Survey_X_reset,
Svy.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/
Svy_ListAllSurveys (&SvyQst);
@ -1668,9 +1668,9 @@ void Svy_HideSurvey (void)
DB_QueryUPDATE (Query,"can not hide survey");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Survey_X_is_now_hidden,
sprintf (Gbl.Alert.Txt,Txt_Survey_X_is_now_hidden,
Svy.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/
Svy_ListAllSurveys (&SvyQst);
@ -1702,9 +1702,9 @@ void Svy_UnhideSurvey (void)
DB_QueryUPDATE (Query,"can not show survey");
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Survey_X_is_now_visible,
sprintf (Gbl.Alert.Txt,Txt_Survey_X_is_now_visible,
Svy.Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show surveys again *****/
Svy_ListAllSurveys (&SvyQst);
@ -2141,9 +2141,9 @@ void Svy_RecFormSurvey (void)
if (Svy_CheckIfSimilarSurveyExists (&NewSvy))
{
NewSurveyIsCorrect = false;
sprintf (Gbl.Message,Txt_Already_existed_a_survey_with_the_title_X,
sprintf (Gbl.Alert.Txt,Txt_Already_existed_a_survey_with_the_title_X,
NewSvy.Title);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // If there is not a survey title
@ -2230,9 +2230,9 @@ static void Svy_CreateSurvey (struct Survey *Svy,const char *Txt)
Svy_CreateGrps (Svy->SvyCod);
/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_survey_X,
sprintf (Gbl.Alert.Txt,Txt_Created_new_survey_X,
Svy->Title);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -2620,7 +2620,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,
if (NumAnswers > Svy_MAX_ANSWERS_PER_QUESTION)
Lay_ShowErrorAndExit ("Wrong answer.");
if (!Svy_AllocateTextChoiceAnswer (SvyQst,NumAns))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
Str_Copy (SvyQst->AnsChoice[NumAns].Text,row[2],
Svy_MAX_BYTES_ANSWER);
@ -2860,7 +2860,7 @@ static int Svy_AllocateTextChoiceAnswer (struct SurveyQuestion *SvyQst,unsigned
Svy_FreeTextChoiceAnswer (SvyQst,NumAns);
if ((SvyQst->AnsChoice[NumAns].Text = malloc (Svy_MAX_BYTES_ANSWER + 1)) == NULL)
{
sprintf (Gbl.Message,"Not enough memory to store answer.");
sprintf (Gbl.Alert.Txt,"Not enough memory to store answer.");
return 0;
}
SvyQst->AnsChoice[NumAns].Text[0] = '\0';
@ -3517,9 +3517,9 @@ void Svy_RequestRemoveQst (void)
/***** Show question and button to remove question *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_question_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) (SvyQst.QstInd + 1));
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
Gbl.Svys.SvyCodToEdit = SvyCod;
@ -3572,8 +3572,8 @@ void Svy_RemoveQst (void)
DB_QueryUPDATE (Query,"can not update indexes of questions");
/***** Write message *****/
sprintf (Gbl.Message,"%s",Txt_Question_removed);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,"%s",Txt_Question_removed);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Show current survey *****/
Svy_ShowOneSurvey (SvyCod,&SvyQst,true);

View File

@ -564,14 +564,14 @@ void Tst_AssessTest (void)
Tst_SetTstStatus (NumTst,Tst_STATUS_ASSESSED);
break;
case Tst_STATUS_ASSESSED:
sprintf (Gbl.Message,Txt_The_test_X_has_already_been_assessed_previously,
sprintf (Gbl.Alert.Txt,Txt_The_test_X_has_already_been_assessed_previously,
NumTst);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
break;
case Tst_STATUS_ERROR:
sprintf (Gbl.Message,Txt_There_was_an_error_in_assessing_the_test_X,
sprintf (Gbl.Alert.Txt,Txt_There_was_an_error_in_assessing_the_test_X,
NumTst);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
break;
}
}
@ -678,7 +678,7 @@ static bool Tst_CheckIfNextTstAllowed (void)
if (NumSecondsFromNowToNextAccTst > 0)
{
/***** Write warning *****/
sprintf (Gbl.Message,"%s:<br /><span id=\"date_next_test\"></span>."
sprintf (Gbl.Alert.Txt,"%s:<br /><span id=\"date_next_test\"></span>."
"<script type=\"text/javascript\">"
"writeLocalDateHMSFromUTC('date_next_test',%ld,"
"%u,',&nbsp;','%s',true,true,0x7);"
@ -686,7 +686,7 @@ static bool Tst_CheckIfNextTstAllowed (void)
Txt_You_can_not_take_a_new_test_until,
(long) TimeNextTestUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
return false;
}
@ -1460,9 +1460,9 @@ void Tst_RenameTag (void)
/***** Check that the new tag is not empty *****/
if (!NewTagTxt[0]) // New tag empty
{
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_tag_X_empty,
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_tag_X_empty,
OldTagTxt);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else // New tag not empty
{
@ -1472,9 +1472,9 @@ void Tst_RenameTag (void)
// This happens when user press INTRO
// without changing anything in the form.
{
sprintf (Gbl.Message,Txt_The_tag_X_has_not_changed,
sprintf (Gbl.Alert.Txt,Txt_The_tag_X_has_not_changed,
NewTagTxt);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else // The old and the new tag
// are not exactly the same (case sensitively).
@ -1556,9 +1556,9 @@ void Tst_RenameTag (void)
}
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_tag_X_has_been_renamed_as_Y,
sprintf (Gbl.Alert.Txt,Txt_The_tag_X_has_been_renamed_as_Y,
OldTagTxt,NewTagTxt);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}
@ -3408,7 +3408,7 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle
/***** Allocate memory for text in this choice answer *****/
if (!Tst_AllocateTextChoiceAnswer (NumOpt))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
/***** Assign index (row[0]). Index is 0,1,2,3... if no shuffle or 1,3,0,2... (example) if shuffle *****/
// Index is got from databse query
@ -3518,7 +3518,7 @@ static void Tst_WriteChoiceAnsAssessTest (unsigned NumQst,MYSQL_RES *mysql_res,
/***** Allocate memory for text in this choice option *****/
if (!Tst_AllocateTextChoiceAnswer (NumOpt))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
/***** Copy answer text (row[1]) and convert it,
that is in HTML, to rigorous HTML ******/
@ -3760,7 +3760,7 @@ static void Tst_WriteTextAnsAssessTest (unsigned NumQst,MYSQL_RES *mysql_res,
/***** Allocate memory for text in this choice answer *****/
if (!Tst_AllocateTextChoiceAnswer (NumOpt))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
/***** Copy answer text (row[1]) and convert it, that is in HTML, to rigorous HTML ******/
Str_Copy (Gbl.Test.Answer.Options[NumOpt].Text,row[1],
@ -4321,9 +4321,9 @@ static bool Tst_GetParamsTst (void)
if (Gbl.Test.NumQsts < Gbl.Test.Config.Min ||
Gbl.Test.NumQsts > Gbl.Test.Config.Max)
{
sprintf (Gbl.Message,Txt_The_number_of_questions_must_be_in_the_interval_X,
sprintf (Gbl.Alert.Txt,Txt_The_number_of_questions_must_be_in_the_interval_X,
Gbl.Test.Config.Min,Gbl.Test.Config.Max);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
Error = true;
}
}
@ -4970,13 +4970,13 @@ int Tst_AllocateTextChoiceAnswer (unsigned NumOpt)
if ((Gbl.Test.Answer.Options[NumOpt].Text =
malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL)
{
sprintf (Gbl.Message,"Not enough memory to store answer.");
sprintf (Gbl.Alert.Txt,"Not enough memory to store answer.");
return 0;
}
if ((Gbl.Test.Answer.Options[NumOpt].Feedback =
malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL)
{
sprintf (Gbl.Message,"Not enough memory to store feedback.");
sprintf (Gbl.Alert.Txt,"Not enough memory to store feedback.");
return 0;
}
@ -5166,7 +5166,7 @@ static void Tst_GetQstDataFromDB (char Stem[Cns_MAX_BYTES_TEXT + 1],
if (Gbl.Test.Answer.NumOptions > Tst_MAX_OPTIONS_PER_QUESTION)
Lay_ShowErrorAndExit ("Wrong answer.");
if (!Tst_AllocateTextChoiceAnswer (NumOpt))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
Str_Copy (Gbl.Test.Answer.Options[NumOpt].Text,row[1],
Tst_MAX_BYTES_ANSWER_OR_FEEDBACK);
@ -5372,18 +5372,18 @@ static void Tst_GetQstFromForm (char *Stem,char *Feedback)
{
case Tst_ANS_INT:
if (!Tst_AllocateTextChoiceAnswer (0))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
Par_GetParToText ("AnsInt",Gbl.Test.Answer.Options[0].Text,1 + 10);
break;
case Tst_ANS_FLOAT:
if (!Tst_AllocateTextChoiceAnswer (0))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
Par_GetParToText ("AnsFloatMin",Gbl.Test.Answer.Options[0].Text,
Tst_MAX_BYTES_FLOAT_ANSWER);
if (!Tst_AllocateTextChoiceAnswer (1))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
Par_GetParToText ("AnsFloatMax",Gbl.Test.Answer.Options[1].Text,
Tst_MAX_BYTES_FLOAT_ANSWER);
break;
@ -5403,7 +5403,7 @@ static void Tst_GetQstFromForm (char *Stem,char *Feedback)
NumOpt++)
{
if (!Tst_AllocateTextChoiceAnswer (NumOpt))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
/* Get answer */
sprintf (AnsStr,"AnsStr%u",NumOpt);
@ -5785,13 +5785,13 @@ static long Tst_GetTagCodFromTagTxt (const char *TagTxt)
row = mysql_fetch_row (mysql_res);
if ((TagCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
{
sprintf (Gbl.Message,"%s","Wrong code of tag.");
sprintf (Gbl.Alert.Txt,"%s","Wrong code of tag.");
Error = true;
}
}
else if (NumRows > 1)
{
sprintf (Gbl.Message,"%s","Duplicated tag.");
sprintf (Gbl.Alert.Txt,"%s","Duplicated tag.");
Error = true;
}
@ -5799,7 +5799,7 @@ static long Tst_GetTagCodFromTagTxt (const char *TagTxt)
DB_FreeMySQLResult (&mysql_res);
if (Error)
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
return TagCod;
}
@ -5874,9 +5874,9 @@ void Tst_RequestRemoveQst (void)
/***** Show question and button to remove question *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_question_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) Gbl.Test.QstCod);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);
/* End alert */
if (EditingOnlyThisQst)
@ -5998,11 +5998,11 @@ void Tst_ChangeShuffleQst (void)
DB_QueryUPDATE (Query,"can not update the shuffle type of a question");
/***** Write message *****/
sprintf (Gbl.Message,
sprintf (Gbl.Alert.Txt,
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,
Gbl.Test.QstCod);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
/***** Continue editing questions *****/
if (EditingOnlyThisQst)

View File

@ -425,8 +425,8 @@ void TsI_ImportQstsFromXML (void)
if (WrongType)
{
sprintf (Gbl.Message,Txt_The_file_is_not_X,"xml");
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"xml");
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
else
{
@ -828,7 +828,7 @@ static void TsI_GetAnswerFromXML (struct XMLElement *AnswerElem)
{
case Tst_ANS_INT:
if (!Tst_AllocateTextChoiceAnswer (0))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
if (AnswerElem->Content)
Str_Copy (Gbl.Test.Answer.Options[0].Text,AnswerElem->Content,
@ -836,9 +836,9 @@ static void TsI_GetAnswerFromXML (struct XMLElement *AnswerElem)
break;
case Tst_ANS_FLOAT:
if (!Tst_AllocateTextChoiceAnswer (0))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
if (!Tst_AllocateTextChoiceAnswer (1))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
for (LowerUpperElem = AnswerElem->FirstChild;
LowerUpperElem != NULL;
@ -890,7 +890,7 @@ static void TsI_GetAnswerFromXML (struct XMLElement *AnswerElem)
if (!strcmp (OptionElem->TagName,"option"))
{
if (!Tst_AllocateTextChoiceAnswer (NumOpt))
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
for (TextElem = OptionElem->FirstChild;
TextElem != NULL;

View File

@ -220,7 +220,7 @@ void Usr_InformAboutNumClicksBeforePhoto (void)
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_You_must_send_your_photo_because_;
extern const char *Txt_You_can_only_perform_X_further_actions_;
char Message[512]; // Don't use Gbl.Message here, because it may be filled with another message and such message would be overwritten
char Message[512]; // Don't use Gbl.Alert.Txt here, because it may be filled with another message and such message would be overwritten
if (Gbl.Usrs.Me.NumAccWithoutPhoto)
{
@ -2112,13 +2112,13 @@ void Usr_WelcomeUsr (void)
Gbl.Prefs.PathIconSet,Cfg_ICON_128x128,
Txt_Happy_birthday,
Txt_Happy_birthday);
sprintf (Gbl.Message,Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex],
sprintf (Gbl.Alert.Txt,Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex],
Gbl.Usrs.Me.UsrDat.FirstName);
}
if (!CongratulateMyBirthday)
sprintf (Gbl.Message,Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex],
sprintf (Gbl.Alert.Txt,Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex],
Gbl.Usrs.Me.UsrDat.FirstName);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]);
@ -2387,9 +2387,9 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
if (Wrong)
{
/***** String is not a valid user's nickname, email or ID *****/
sprintf (Gbl.Message,Txt_The_ID_nickname_or_email_X_is_not_valid,
sprintf (Gbl.Alert.Txt,Txt_The_ID_nickname_or_email_X_is_not_valid,
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
return ListUsrCods->NumUsrs;
@ -2819,9 +2819,9 @@ static void Usr_ShowAlertThereAreMoreThanOneUsr (void)
Gbl.Action.Act = ActFrmLogIn;
Tab_SetCurrentTab ();
sprintf (Gbl.Message,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
Gbl.Usrs.Me.UsrIdLogin);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -3017,10 +3017,10 @@ void Usr_ShowFormsLogoutAndRole (void)
/***** Write message with my new logged role *****/
if (Gbl.Usrs.Me.RoleHasChanged)
{
sprintf (Gbl.Message,Txt_You_are_now_LOGGED_IN_as_X,
sprintf (Gbl.Alert.Txt,Txt_You_are_now_LOGGED_IN_as_X,
Txt_logged[Gbl.Usrs.Me.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.LoggedRole][Gbl.Usrs.Me.UsrDat.Sex]);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
/***** Start frame *****/
@ -5020,8 +5020,8 @@ static void Usr_AllocateUsrsList (Rol_Role_t Role)
/*
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
{
sprintf (Gbl.Message,"Memory used by list = %lu",(long) sizeof (struct UsrInList) * NumUsrs);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
sprintf (Gbl.Alert.Txt,"Memory used by list = %lu",(long) sizeof (struct UsrInList) * NumUsrs);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
*/
if (Gbl.Usrs.LstUsrs[Role].NumUsrs)
@ -5107,9 +5107,9 @@ static void Usr_ShowWarningListIsTooBig (unsigned NumUsrs)
{
extern const char *Txt_The_list_of_X_users_is_too_large_to_be_displayed;
sprintf (Gbl.Message,Txt_The_list_of_X_users_is_too_large_to_be_displayed,
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_users_is_too_large_to_be_displayed,
NumUsrs);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
/*****************************************************************************/
@ -5159,9 +5159,9 @@ void Usr_GetListsSelectedUsrsCods (void)
Par_GetParMultiToText ("UsrCodStd",Gbl.Usrs.Select.Std,
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); // Students
/*
sprintf (Gbl.Message,"UsrCodAll = %s / UsrCodTch = %s / UsrCodStd = %s",
sprintf (Gbl.Alert.Txt,"UsrCodAll = %s / UsrCodTch = %s / UsrCodStd = %s",
Gbl.Usrs.Select.All,Gbl.Usrs.Select.Tch,Gbl.Usrs.Select.Std);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
*/
/***** Add teachers to the list with all selected users *****/
if (Gbl.Usrs.Select.Tch[0])
@ -5255,9 +5255,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Message,Txt_There_is_no_user_with_nickname_X,
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_nickname_X,
UsrIDNickOrEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
Error = true;
}
@ -5274,9 +5274,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Message,Txt_There_is_no_user_with_email_X,
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_email_X,
UsrIDNickOrEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
Error = true;
}
@ -5302,9 +5302,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{// TODO: Consider forbid IDs here
if (WriteErrorMsgs)
{
sprintf (Gbl.Message,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
UsrIDNickOrEmail);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
Error = true;
}
@ -5313,9 +5313,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Message,Txt_There_is_no_user_with_ID_nick_or_email_X,
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_ID_nick_or_email_X,
UsrIDNickOrEmail);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
Lay_ShowAlert (Lay_ERROR,Gbl.Alert.Txt);
}
Error = true;
}
@ -5324,9 +5324,9 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Message,Txt_The_ID_nickname_or_email_X_is_not_valid,
sprintf (Gbl.Alert.Txt,Txt_The_ID_nickname_or_email_X_is_not_valid,
UsrIDNickOrEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
Error = true;
}

View File

@ -151,13 +151,13 @@ static void XML_GetElement (struct XMLElement *ParentElem)
EndTagNameLength = strcspn (Gbl.XMLPtr,">");
if (ParentElem->TagNameLength != EndTagNameLength)
{
sprintf (Gbl.Message,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Message);
sprintf (Gbl.Alert.Txt,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
if (strncmp (ParentElem->TagName,Gbl.XMLPtr,EndTagNameLength)) // XML tags are case sensitive
{
sprintf (Gbl.Message,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Message);
sprintf (Gbl.Alert.Txt,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
// End of parent element found!
@ -360,9 +360,9 @@ static void XML_GetAttributes (struct XMLElement *Elem)
}
else
{
sprintf (Gbl.Message,"XML syntax error after attribute &quot;%s&quot; inside element &quot;%s&quot;.",
sprintf (Gbl.Alert.Txt,"XML syntax error after attribute &quot;%s&quot; inside element &quot;%s&quot;.",
Attribute->AttributeName,Elem->TagName);
Lay_ShowErrorAndExit (Gbl.Message);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
if ((Attribute->Content = malloc (Attribute->ContentLength + 1)) == NULL)