Version 18.46.7

This commit is contained in:
Antonio Cañas Vargas 2019-02-16 17:20:05 +01:00
parent 7de9865d15
commit 001f4938dc
8 changed files with 88 additions and 153 deletions

View File

@ -124,7 +124,7 @@ void Ale_ShowAlert (Ale_AlertType_t AlertType,const char *fmt,...)
// vasprintf will return -1 // vasprintf will return -1
Lay_NotEnoughMemoryExit (); Lay_NotEnoughMemoryExit ();
Ale_ShowAlert (AlertType,Txt); Ale_ShowFixAlert (AlertType,Txt);
free ((void *) Txt); free ((void *) Txt);
} }

View File

@ -383,6 +383,8 @@ OPTIMIZE TABLE debug;
// TODO: Revisar todos los Ale_ShowAlertAndButton // TODO: Revisar todos los Ale_ShowAlertAndButton
// TODO: Pasar a una función Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -402,10 +404,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.46.6 (2019-02-16)" #define Log_PLATFORM_VERSION "SWAD 18.46.7 (2019-02-16)"
#define CSS_FILE "swad18.41.1.css" #define CSS_FILE "swad18.41.1.css"
#define JS_FILE "swad18.32.1.js" #define JS_FILE "swad18.32.1.js"
/* /*
Version 18.46.7: Feb 16, 2019 Refactoring code related to alerts. (237953 lines)
Version 18.46.6: Feb 16, 2019 Refactoring code related to alerts. (238019 lines) Version 18.46.6: Feb 16, 2019 Refactoring code related to alerts. (238019 lines)
Version 18.46.5: Feb 16, 2019 Refactoring code related to alerts. (238062 lines) Version 18.46.5: Feb 16, 2019 Refactoring code related to alerts. (238062 lines)
Version 18.46.4: Feb 16, 2019 Refactoring code related to alerts. (238061 lines) Version 18.46.4: Feb 16, 2019 Refactoring code related to alerts. (238061 lines)

View File

@ -1761,10 +1761,8 @@ void Ins_RemoveInstitution (void)
Ins_FlushCacheFullNameAndCtyOfInstitution (); Ins_FlushCacheFullNameAndCtyOfInstitution ();
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_Institution_X_removed,
Txt_Institution_X_removed, Ins.FullName);
Ins.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
/***** Show the form again *****/ /***** Show the form again *****/
@ -2025,14 +2023,14 @@ void Ins_ChangeInsWWW (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to institution changed *****/ and put button to go to institution changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.DelayedAlert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_new_web_address_is_X, Txt_The_new_web_address_is_X,
NewWWW); NewWWW);
Ins_ShowAlertAndButtonToGoToIns (); Ins_ShowAlertAndButtonToGoToIns ();
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/ /***** Show the form again *****/
Ins_EditInstitutions (); Ins_EditInstitutions ();
@ -2057,13 +2055,11 @@ void Ins_ChangeInsWWWInConfig (void)
Cns_MAX_BYTES_WWW); Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_web_address_is_X,
Txt_The_new_web_address_is_X, NewWWW);
NewWWW);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/ /***** Show the form again *****/
Ins_ShowConfiguration (); Ins_ShowConfiguration ();
@ -2117,8 +2113,8 @@ void Ins_ChangeInsStatus (void)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to institution changed *****/ and put button to go to institution changed *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.DelayedAlert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_The_status_of_the_institution_X_has_changed, Txt_The_status_of_the_institution_X_has_changed,
Gbl.Inss.EditingIns.ShrtName); Gbl.Inss.EditingIns.ShrtName);
Ins_ShowAlertAndButtonToGoToIns (); Ins_ShowAlertAndButtonToGoToIns ();
@ -2165,7 +2161,7 @@ static void Ins_ShowAlertAndButtonToGoToIns (void)
} }
else else
/***** Alert *****/ /***** Alert *****/
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt); Ale_ShowDelayedAlert ();
} }
static void Ins_PutParamGoToIns (void) static void Ins_PutParamGoToIns (void)
@ -2399,27 +2395,19 @@ static void Ins_RecFormRequestOrCreateIns (unsigned Status)
{ {
/***** If name of institution was in database... *****/ /***** If name of institution was in database... *****/
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.Inss.EditingIns.ShrtName,-1L,Gbl.CurrentCty.Cty.CtyCod)) if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.Inss.EditingIns.ShrtName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Gbl.Inss.EditingIns.ShrtName);
Txt_The_institution_X_already_exists,
Gbl.Inss.EditingIns.ShrtName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.Inss.EditingIns.FullName,-1L,Gbl.CurrentCty.Cty.CtyCod)) else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.Inss.EditingIns.FullName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Gbl.Inss.EditingIns.FullName);
Txt_The_institution_X_already_exists,
Gbl.Inss.EditingIns.FullName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else // Add new institution to database else // Add new institution to database
Ins_CreateInstitution (Status); Ins_CreateInstitution (Status);
} }
else // If there is not a web else // If there is not a web
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_web_address_of_the_new_institution); Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_web_address_of_the_new_institution);
} }
else // If there is not a institution name else // If there is not a institution name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_institution); Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_institution);
/***** Show the form again *****/ /***** Show the form again *****/
Ins_EditInstitutions (); Ins_EditInstitutions ();
@ -2450,8 +2438,8 @@ static void Ins_CreateInstitution (unsigned Status)
/***** Write message to show the change made /***** Write message to show the change made
and put button to go to institution created *****/ and put button to go to institution created *****/
Gbl.Alert.Type = Ale_SUCCESS; Gbl.DelayedAlert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_Created_new_institution_X, Txt_Created_new_institution_X,
Gbl.Inss.EditingIns.FullName); Gbl.Inss.EditingIns.FullName);
Ins_ShowAlertAndButtonToGoToIns (); Ins_ShowAlertAndButtonToGoToIns ();

View File

@ -1269,7 +1269,7 @@ void Lay_ShowErrorAndExit (const char *Txt)
/***** Write possible error message *****/ /***** Write possible error message *****/
if (Txt) if (Txt)
Ale_ShowA_old (Ale_ERROR,Txt); Ale_ShowAlert (Ale_ERROR,Txt);
/***** Finish the page, except </body> and </html> *****/ /***** Finish the page, except </body> and </html> *****/
Lay_WriteEndOfPage (); Lay_WriteEndOfPage ();

View File

@ -104,7 +104,7 @@ void Lnk_SeeLinks (void)
if (Gbl.Links.Num) // There are links if (Gbl.Links.Num) // There are links
Lnk_WriteListOfLinks (); Lnk_WriteListOfLinks ();
else // No links created else // No links created
Ale_ShowA_old (Ale_INFO,Txt_No_links); Ale_ShowAlert (Ale_INFO,Txt_No_links);
/***** Button to create link *****/ /***** Button to create link *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
@ -507,10 +507,8 @@ void Lnk_RemoveLink (void)
Lnk.LnkCod); Lnk.LnkCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_Link_X_removed,
Txt_Link_X_removed, Lnk.ShrtName);
Lnk.ShrtName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
Lnk_EditLinks (); Lnk_EditLinks ();
@ -581,12 +579,8 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewLnkName[0]) if (!NewLnkName[0])
{ Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_link_X_empty,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), CurrentLnkName);
Txt_You_can_not_leave_the_name_of_the_link_X_empty,
CurrentLnkName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else else
{ {
/***** Check if old and new names are the same /***** Check if old and new names are the same
@ -595,31 +589,21 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/***** If link was in database... *****/ /***** If link was in database... *****/
if (Lnk_CheckIfLinkNameExists (ParamName,NewLnkName,Lnk->LnkCod)) if (Lnk_CheckIfLinkNameExists (ParamName,NewLnkName,Lnk->LnkCod))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_link_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), NewLnkName);
Txt_The_link_X_already_exists,
NewLnkName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else else
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Lnk_UpdateLnkNameDB (Lnk->LnkCod,FieldName,NewLnkName); Lnk_UpdateLnkNameDB (Lnk->LnkCod,FieldName,NewLnkName);
/* Write message to show the change made */ /* Write message to show the change made */
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_The_link_X_has_been_renamed_as_Y,
Txt_The_link_X_has_been_renamed_as_Y, CurrentLnkName,NewLnkName);
CurrentLnkName,NewLnkName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
} }
else // The same name else // The same name
{ Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_link_X_has_not_changed,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), CurrentLnkName);
Txt_The_name_of_the_link_X_has_not_changed,
CurrentLnkName);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
}
} }
/***** Show the form again *****/ /***** Show the form again *****/
@ -684,13 +668,11 @@ void Lnk_ChangeLinkWWW (void)
NewWWW,Lnk->LnkCod); NewWWW,Lnk->LnkCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_web_address_is_X,
Txt_The_new_web_address_is_X, NewWWW);
NewWWW);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty); Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/ /***** Show the form again *****/
Str_Copy (Lnk->WWW,NewWWW, Str_Copy (Lnk->WWW,NewWWW,
@ -820,26 +802,18 @@ void Lnk_RecFormNewLink (void)
{ {
/***** If name of link was in database... *****/ /***** If name of link was in database... *****/
if (Lnk_CheckIfLinkNameExists ("ShortName",Lnk->ShrtName,-1L)) if (Lnk_CheckIfLinkNameExists ("ShortName",Lnk->ShrtName,-1L))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_link_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Lnk->ShrtName);
Txt_The_link_X_already_exists,
Lnk->ShrtName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Lnk_CheckIfLinkNameExists ("FullName",Lnk->FullName,-1L)) else if (Lnk_CheckIfLinkNameExists ("FullName",Lnk->FullName,-1L))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_link_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Lnk->FullName);
Txt_The_link_X_already_exists,
Lnk->FullName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else if (!Lnk->WWW[0]) else if (!Lnk->WWW[0])
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_URL_of_the_new_link); Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_URL_of_the_new_link);
else // Add new link to database else // Add new link to database
Lnk_CreateLink (Lnk); Lnk_CreateLink (Lnk);
} }
else // If there is not a link name else // If there is not a link name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_link); Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_link);
/***** Show the form again *****/ /***** Show the form again *****/
Lnk_EditLinks (); Lnk_EditLinks ();
@ -862,8 +836,6 @@ static void Lnk_CreateLink (struct Link *Lnk)
Lnk->ShrtName,Lnk->FullName,Lnk->WWW); Lnk->ShrtName,Lnk->FullName,Lnk->WWW);
/***** Write success message *****/ /***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_link_X,
Txt_Created_new_link_X, Lnk->ShrtName);
Lnk->ShrtName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }

View File

@ -292,10 +292,8 @@ void Log_RequestLogo (Sco_Scope_t Scope)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/ /***** Write help message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_INFO,Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y,
Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y, 64,64);
64,64);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
/***** Upload logo *****/ /***** Upload logo *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">" fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -385,12 +383,8 @@ void Log_ReceiveLogo (Sco_Scope_t Scope)
if (strcmp (MIMEType,"application/octet")) if (strcmp (MIMEType,"application/octet"))
WrongType = true; WrongType = true;
if (WrongType) if (WrongType)
{ Ale_ShowAlert (Ale_WARNING,Txt_The_file_is_not_X,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), "png");
Txt_The_file_is_not_X,
"png");
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else else
{ {
/* End the reception of logo in a temporary file */ /* End the reception of logo in a temporary file */
@ -401,7 +395,7 @@ void Log_ReceiveLogo (Sco_Scope_t Scope)
(unsigned) Cod, (unsigned) Cod,
(unsigned) Cod); (unsigned) Cod);
if (!Fil_EndReceptionOfFile (FileNameLogo,Param)) if (!Fil_EndReceptionOfFile (FileNameLogo,Param))
Ale_ShowA_old (Ale_WARNING,"Error copying file."); Ale_ShowAlert (Ale_ERROR,"Error copying file.");
} }
} }

View File

@ -375,14 +375,12 @@ void Mai_WriteWarningEmailNotifications (void)
Tab_Tab_t TabMyAccount = Act_GetTab (ActFrmMyAcc ); Tab_Tab_t TabMyAccount = Act_GetTab (ActFrmMyAcc );
Tab_Tab_t TabMailDomains = Act_GetTab (ActSeeMai); Tab_Tab_t TabMailDomains = Act_GetTab (ActSeeMai);
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_WARNING,Txt_You_can_only_receive_email_notifications_if_,
Txt_You_can_only_receive_email_notifications_if_, Txt_TABS_TXT [TabMyAccount ],
Txt_TABS_TXT [TabMyAccount ], Txt_MENU_TITLE[TabMyAccount ][Act_GetIndexInMenu (ActFrmMyAcc)],
Txt_MENU_TITLE[TabMyAccount ][Act_GetIndexInMenu (ActFrmMyAcc)], Txt_TABS_TXT [TabMailDomains],
Txt_TABS_TXT [TabMailDomains], Txt_MENU_TITLE[TabMailDomains][Act_GetIndexInMenu (ActSeeMai )],
Txt_MENU_TITLE[TabMailDomains][Act_GetIndexInMenu (ActSeeMai )], Txt_Domains);
Txt_Domains);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -559,10 +557,8 @@ void Mai_RemoveMailDomain (void)
Mai.MaiCod); Mai.MaiCod);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_Email_domain_X_removed,
Txt_Email_domain_X_removed, Mai.Domain);
Mai.Domain);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/ /***** Show the form again *****/
Mai_EditMailDomains (); Mai_EditMailDomains ();
@ -823,24 +819,16 @@ void Mai_RecFormNewMailDomain (void)
{ {
/***** If name of mail was in database... *****/ /***** If name of mail was in database... *****/
if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L)) if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_email_domain_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Mai->Domain);
Txt_The_email_domain_X_already_exists,
Mai->Domain);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L)) else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L))
{ Ale_ShowAlert (Ale_WARNING,Txt_The_email_domain_X_already_exists,
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Mai->Info);
Txt_The_email_domain_X_already_exists,
Mai->Info);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
else // Add new mail to database else // Add new mail to database
Mai_CreateMailDomain (Mai); Mai_CreateMailDomain (Mai);
} }
else // If there is not a mail name else // If there is not a mail name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_email_domain); Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_email_domain);
/***** Show the form again *****/ /***** Show the form again *****/
Mai_EditMailDomains (); Mai_EditMailDomains ();
@ -863,10 +851,8 @@ static void Mai_CreateMailDomain (struct Mail *Mai)
Mai->Domain,Mai->Info); Mai->Domain,Mai->Info);
/***** Write success message *****/ /***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_email_domain_X,
Txt_Created_new_email_domain_X, Mai->Domain);
Mai->Domain);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1233,13 +1219,13 @@ static void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe,
/***** Show possible alert *****/ /***** Show possible alert *****/
if (Gbl.Alert.Section == (const char *) Mai_EMAIL_SECTION_ID) if (Gbl.Alert.Section == (const char *) Mai_EMAIL_SECTION_ID)
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt); Ale_ShowDelayedAlert ();
/***** Help message *****/ /***** Help message *****/
if (IMustFillInEmail) if (IMustFillInEmail)
Ale_ShowA_old (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_in_your_email_address); Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_in_your_email_address);
else if (IShouldConfirmEmail) else if (IShouldConfirmEmail)
Ale_ShowA_old (Ale_WARNING,Txt_Please_confirm_your_email_address); Ale_ShowAlert (Ale_WARNING,Txt_Please_confirm_your_email_address);
/***** Get my emails *****/ /***** Get my emails *****/
NumEmails = (unsigned) DB_QuerySELECT (&mysql_res,"can not get" NumEmails = (unsigned) DB_QuerySELECT (&mysql_res,"can not get"
@ -1445,10 +1431,10 @@ void Mai_RemoveOtherUsrEmail (void)
Acc_ShowFormChgOtherUsrAccount (); Acc_ShowFormChgOtherUsrAccount ();
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
} }
else // User not found else // User not found
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1480,11 +1466,7 @@ static void Mai_RemoveEmail (struct UsrData *UsrDat)
Mai_GetEmailFromUsrCod (UsrDat); Mai_GetEmailFromUsrCod (UsrDat);
} }
else else
{ Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1536,10 +1518,10 @@ void Mai_NewOtherUsrEmail (void)
Acc_ShowFormChgOtherUsrAccount (); Acc_ShowFormChgOtherUsrAccount ();
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
} }
else // User not found else // User not found
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1838,9 +1820,8 @@ void Mai_ConfirmEmail (void)
/***** Confirm email *****/ /***** Confirm email *****/
if (Confirmed) if (Confirmed)
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_Email_X_has_already_been_confirmed_before,
Txt_Email_X_has_already_been_confirmed_before, Email);
Email);
else else
{ {
DB_QueryUPDATE ("can not confirm email", DB_QueryUPDATE ("can not confirm email",
@ -1849,20 +1830,18 @@ void Mai_ConfirmEmail (void)
" AND usr_emails.E_mail='%s'", " AND usr_emails.E_mail='%s'",
UsrCod,Email); UsrCod,Email);
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_The_email_X_has_been_confirmed,
Txt_The_email_X_has_been_confirmed, Email);
Email);
} }
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_The_email_address_has_not_been_confirmed); Ale_ShowAlert (Ale_WARNING,Txt_The_email_address_has_not_been_confirmed);
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
} }
else else
Ale_ShowA_old (Ale_WARNING,Txt_Failed_email_confirmation_key); Ale_ShowAlert (Ale_WARNING,Txt_Failed_email_confirmation_key);
/***** Form to log in *****/ /***** Form to log in *****/
Usr_WriteFormLogin (ActLogIn,NULL); Usr_WriteFormLogin (ActLogIn,NULL);

View File

@ -283,10 +283,8 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.FullPathInTree);
/***** Write message of success *****/ /***** Write message of success *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Ale_ShowAlert (Ale_SUCCESS,Txt_The_number_of_rows_is_now_X,
Txt_The_number_of_rows_is_now_X, NumRows);
NumRows);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
} }
else else
Lay_ShowErrorAndExit ("Wrong number of rows."); Lay_ShowErrorAndExit ("Wrong number of rows.");
@ -466,8 +464,8 @@ static bool Mrk_GetUsrMarks (FILE *FileUsrMarks,struct UsrData *UsrDat,
/***** Open HTML file with the table of marks *****/ /***** Open HTML file with the table of marks *****/
if (!(FileAllMarks = fopen (PathFileAllMarks,"rb"))) if (!(FileAllMarks = fopen (PathFileAllMarks,"rb")))
{ // Can't open the file with the table of marks { // Can't open the file with the table of marks
Gbl.Alert.Type = Ale_ERROR; Gbl.DelayedAlert.Type = Ale_ERROR;
Str_Copy (Gbl.Alert.Txt,"Can not open file of marks.", Str_Copy (Gbl.DelayedAlert.Txt,"Can not open file of marks.",
Ale_MAX_BYTES_ALERT); Ale_MAX_BYTES_ALERT);
return false; return false;
} }
@ -603,7 +601,8 @@ static bool Mrk_GetUsrMarks (FILE *FileUsrMarks,struct UsrData *UsrDat,
/***** User's ID not found in table *****/ /***** User's ID not found in table *****/
fclose (FileAllMarks); fclose (FileAllMarks);
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt), Gbl.DelayedAlert.Type = Ale_WARNING;
snprintf (Gbl.DelayedAlert.Txt,sizeof (Gbl.DelayedAlert.Txt),
Txt_THE_USER_X_is_not_found_in_the_file_of_marks, Txt_THE_USER_X_is_not_found_in_the_file_of_marks,
UsrDat->FullName); UsrDat->FullName);
return false; return false;
@ -715,7 +714,7 @@ void Mrk_ShowMyMarks (void)
else // Problems in table of marks or user's ID not found else // Problems in table of marks or user's ID not found
{ {
fclose (FileUsrMarks); fclose (FileUsrMarks);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt); Ale_ShowDelayedAlert ();
} }
unlink (FileNameUsrMarks); // File with marks is no longer necessary unlink (FileNameUsrMarks); // File with marks is no longer necessary