Version 18.46.8

This commit is contained in:
Antonio Cañas Vargas 2019-02-16 18:11:52 +01:00
parent 001f4938dc
commit 5a6e0111ba
11 changed files with 118 additions and 208 deletions

View File

@ -404,10 +404,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.46.7 (2019-02-16)"
#define Log_PLATFORM_VERSION "SWAD 18.46.8 (2019-02-16)"
#define CSS_FILE "swad18.41.1.css"
#define JS_FILE "swad18.32.1.js"
/*
Version 18.46.8: Feb 16, 2019 Refactoring code related to alerts. (237863 lines)
Version 18.46.7: Feb 16, 2019 Refactoring code related to alerts. (237953 lines)
Version 18.46.6: Feb 16, 2019 Refactoring code related to alerts. (238019 lines)
Version 18.46.5: Feb 16, 2019 Refactoring code related to alerts. (238062 lines)

View File

@ -702,14 +702,14 @@ void Msg_RecMsgFromUsr (void)
NumRecipients > Cfg_MAX_RECIPIENTS)
{
/* Write warning message */
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_send_a_message_to_so_many_recipients_);
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_send_a_message_to_so_many_recipients_);
Error = true;
}
}
else // No recipients selected
{
/* Write warning message */
Ale_ShowA_old (Ale_WARNING,Txt_You_must_select_one_ore_more_recipients);
Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_recipients);
Error = true;
}
@ -752,13 +752,9 @@ void Msg_RecMsgFromUsr (void)
RecipientHasBannedMe = Msg_CheckIfUsrIsBanned (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDstData.UsrCod);
if (RecipientHasBannedMe)
{
/***** Show an alert indicating that the message has not been sent successfully *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_message_not_sent_to_X,
UsrDstData.FullName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_message_not_sent_to_X,
UsrDstData.FullName);
else
{
/***** Create message *****/
@ -792,11 +788,9 @@ void Msg_RecMsgFromUsr (void)
0));
/***** Show an alert indicating that the message has been sent successfully *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
Txt_message_sent_to_X_not_notified_by_email,
UsrDstData.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
Txt_message_sent_to_X_not_notified_by_email,
UsrDstData.FullName);
/***** Increment number of recipients *****/
if (NotifyByEmail)
@ -806,7 +800,7 @@ void Msg_RecMsgFromUsr (void)
}
else
{
Ale_ShowA_old (Ale_ERROR,Txt_Error_getting_data_from_a_recipient);
Ale_ShowAlert (Ale_ERROR,Txt_Error_getting_data_from_a_recipient);
NumErrors++;
}
}
@ -830,26 +824,18 @@ void Msg_RecMsgFromUsr (void)
if (NumRecipients)
{
if (NumRecipients == 1)
Ale_ShowA_old (Ale_SUCCESS,Txt_The_message_has_been_sent_to_1_recipient);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_message_has_been_sent_to_1_recipient);
else
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_message_has_been_sent_to_X_recipients,
(unsigned) NumRecipients);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_SUCCESS,Txt_The_message_has_been_sent_to_X_recipients,
(unsigned) NumRecipients);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_The_message_has_not_been_sent_to_any_recipient);
Ale_ShowAlert (Ale_WARNING,Txt_The_message_has_not_been_sent_to_any_recipient);
/***** Show alert about errors on sending message *****/
if (NumErrors > 1)
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_There_have_been_X_errors_in_sending_the_message,
(unsigned) NumErrors);
Ale_ShowA_old (Ale_ERROR,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_ERROR,Txt_There_have_been_X_errors_in_sending_the_message,
(unsigned) NumErrors);
}
/*****************************************************************************/
@ -1010,14 +996,10 @@ static void Msg_ShowNumMsgsDeleted (unsigned NumMsgs)
extern const char *Txt_X_messages_have_been_deleted;
if (NumMsgs == 1)
Ale_ShowA_old (Ale_SUCCESS,Txt_One_message_has_been_deleted);
Ale_ShowAlert (Ale_SUCCESS,Txt_One_message_has_been_deleted);
else
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_X_messages_have_been_deleted,
NumMsgs);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_SUCCESS,Txt_X_messages_have_been_deleted,
NumMsgs);
}
/*****************************************************************************/
@ -1115,7 +1097,7 @@ void Msg_DelSntMsg (void)
/***** Delete the message *****/
/* Delete the sent message */
Msg_MoveSentMsgToDeleted (MsgCod);
Ale_ShowA_old (Ale_SUCCESS,Txt_Message_deleted);
Ale_ShowAlert (Ale_SUCCESS,Txt_Message_deleted);
/* Show the remaining messages */
Msg_ShowSntMsgs ();
@ -1137,7 +1119,7 @@ void Msg_DelRecMsg (void)
/***** Delete the message *****/
/* Delete the received message */
Msg_MoveReceivedMsgToDeleted (MsgCod,Gbl.Usrs.Me.UsrDat.UsrCod);
Ale_ShowA_old (Ale_SUCCESS,Txt_Message_deleted);
Ale_ShowAlert (Ale_SUCCESS,Txt_Message_deleted);
/* Show the remaining messages */
Msg_ShowRecMsgs ();
@ -3718,10 +3700,8 @@ void Msg_BanSenderWhenShowingMsgs (void)
Gbl.Usrs.Other.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show alert with the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_From_this_time_you_will_not_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_From_this_time_you_will_not_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
/**** Show received messages again */
Msg_ShowRecMsgs ();
@ -3775,10 +3755,8 @@ static void Msg_UnbanSender (void)
Gbl.Usrs.Other.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show alert with the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_From_this_time_you_can_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_From_this_time_you_can_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
}
/*****************************************************************************/
@ -3836,7 +3814,7 @@ void Msg_ListBannedUsrs (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
if (NumUsrs == 0) // If not result ==> sent message is deleted
Ale_ShowA_old (Ale_INFO,Txt_You_have_not_banned_any_sender);
Ale_ShowAlert (Ale_INFO,Txt_You_have_not_banned_any_sender);
else
{
/***** Initialize structure with user's data *****/

View File

@ -254,12 +254,11 @@ static void Nck_ShowFormChangeUsrNickname (const struct UsrData *UsrDat,bool Its
/***** Show possible alert *****/
if (Gbl.Alert.Section == (const char *) Nck_NICKNAME_SECTION_ID)
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt);
Ale_ShowDelayedAlert ();
/***** Help message *****/
if (IMustFillNickname)
Ale_ShowA_old (Ale_WARNING,
Txt_Before_going_to_any_other_option_you_must_fill_your_nickname);
Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname);
/***** Start table *****/
Tbl_StartTableWide (2);
@ -488,10 +487,10 @@ void Nck_RemoveOtherUsrNick (void)
Acc_ShowFormChgOtherUsrAccount ();
}
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
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_);
}
/*****************************************************************************/
@ -540,10 +539,10 @@ void Nck_UpdateOtherUsrNick (void)
Acc_ShowFormChgOtherUsrAccount ();
}
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
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_);
}
/*****************************************************************************/

View File

@ -98,10 +98,8 @@ void Not_ShowFormNotice (void)
extern const char *Txt_Create_notice;
/***** Help message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_notice_will_appear_as_a_yellow_note_,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_INFO,Txt_The_notice_will_appear_as_a_yellow_note_,
Gbl.CurrentCrs.Crs.FullName);
/***** Start form *****/
Frm_StartForm (ActRcvNot);
@ -148,7 +146,7 @@ void Not_ReceiveNotice (void)
RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs);
/***** Write message of success *****/
Ale_ShowA_old (Ale_SUCCESS,Txt_Notice_created);
Ale_ShowAlert (Ale_SUCCESS,Txt_Notice_created);
/***** Notify by email about the new notice *****/
if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_NOTICE,NotCod)))
@ -198,7 +196,7 @@ void Not_ListNoticesAfterRemoval (void)
extern const char *Txt_Notice_removed;
/***** Message of success *****/
Ale_ShowA_old (Ale_SUCCESS,Txt_Notice_removed);
Ale_ShowAlert (Ale_SUCCESS,Txt_Notice_removed);
/***** List remaining notices *****/
Not_ListFullNotices ();
@ -404,7 +402,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing)
Not_PutIconsListNotices,
Hlp_MESSAGES_Notices,Box_NOT_CLOSABLE);
if (!NumNotices)
Ale_ShowA_old (Ale_INFO,Txt_No_notices);
Ale_ShowAlert (Ale_INFO,Txt_No_notices);
}
/***** Show the notices *****/

View File

@ -627,7 +627,7 @@ void Ntf_ShowMyNotifications (void)
Usr_UsrDataDestructor (&UsrDat);
}
else
Ale_ShowA_old (Ale_INFO,AllNotifications ? Txt_You_have_no_notifications :
Ale_ShowAlert (Ale_INFO,AllNotifications ? Txt_You_have_no_notifications :
Txt_You_have_no_unread_notifications);
/***** End box *****/
@ -2040,7 +2040,7 @@ void Ntf_ChangeNotifyEvents (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show message *****/
Ale_ShowA_old (Ale_SUCCESS,Txt_Your_preferences_about_notifications_have_changed);
Ale_ShowAlert (Ale_SUCCESS,Txt_Your_preferences_about_notifications_have_changed);
}
/*****************************************************************************/

View File

@ -201,10 +201,10 @@ void Pwd_UpdateOtherUsrPwd (void)
/***** Check and update password *****/
Pwd_CheckAndUpdateNewPwd (&Gbl.Usrs.Other.UsrDat);
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
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_);
}
/*****************************************************************************/
@ -291,7 +291,7 @@ void Pwd_ShowFormSendNewPwd (void)
Hlp_PROFILE_Password,Box_NOT_CLOSABLE);
/***** Help text *****/
Ale_ShowA_old (Ale_INFO,Txt_If_you_have_forgotten_your_password_);
Ale_ShowAlert (Ale_INFO,Txt_If_you_have_forgotten_your_password_);
/***** User's ID/nickname *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -327,7 +327,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
/***** Check if user's ID or nickname is not empty *****/
if (!Gbl.Usrs.Me.UsrIdLogin[0])
{
Ale_ShowA_old (Ale_WARNING,Txt_You_must_enter_your_nick_email_or_ID);
Ale_ShowAlert (Ale_WARNING,Txt_You_must_enter_your_nick_email_or_ID);
Pwd_ShowFormSendNewPwd ();
return;
}
@ -392,7 +392,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
{
case 0: // Message sent successfully
Pwd_SetMyPendingPassword (NewRandomPlainPassword);
Ale_ShowA_old (Ale_INFO,Txt_If_you_have_written_your_ID_nickname_or_email_correctly_);
Ale_ShowAlert (Ale_INFO,Txt_If_you_have_written_your_ID_nickname_or_email_correctly_);
break;
case 1:
Lay_ShowErrorAndExit (Txt_There_was_a_problem_sending_an_email_automatically);
@ -411,7 +411,7 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
Usr_FreeListUsrCods (&ListUsrCods);
/***** Help message *****/
Ale_ShowA_old (Ale_INFO,Txt_If_you_have_written_your_ID_nickname_or_email_correctly_);
Ale_ShowAlert (Ale_INFO,Txt_If_you_have_written_your_ID_nickname_or_email_correctly_);
/**** Show forms to login / create account again *****/
Usr_WriteLandingPage ();
@ -674,7 +674,6 @@ void Pwd_ShowFormChgMyPwd (void)
extern const char *Txt_Change_password;
extern const char *Txt_Set_password;
char StrRecordWidth[10 + 1];
char *Txt;
bool IHaveAPasswordInDB = (bool) Gbl.Usrs.Me.UsrDat.Password[0];
/***** Start section *****/
@ -692,17 +691,15 @@ void Pwd_ShowFormChgMyPwd (void)
/***** Show possible alert *****/
if (Gbl.Alert.Section == Pwd_PASSWORD_SECTION_ID)
Ale_ShowA_old (Gbl.DelayedAlert.Type,Gbl.DelayedAlert.Txt);
Ale_ShowDelayedAlert ();
/***** Help message *****/
if (!IHaveAPasswordInDB) // If I don't have a password in database...
Ale_ShowA_old (Ale_WARNING,
Txt_Before_going_to_any_other_option_you_must_create_your_password);
Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_create_your_password);
else if (Gbl.Usrs.Me.LoginPlainPassword[0])
{
if (!Pwd_FastCheckIfPasswordSeemsGood (Gbl.Usrs.Me.LoginPlainPassword))
Ale_ShowA_old (Ale_WARNING,
Txt_Your_password_is_not_secure_enough);
Ale_ShowAlert (Ale_WARNING,Txt_Your_password_is_not_secure_enough);
}
/***** Start table *****/
@ -728,11 +725,8 @@ void Pwd_ShowFormChgMyPwd (void)
/***** Help message *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">");
if (asprintf (&Txt,Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
Pwd_MIN_CHARS_PLAIN_PASSWORD) < 0)
Lay_NotEnoughMemoryExit ();
Ale_ShowA_old (Ale_INFO,Txt);
free ((void *) Txt);
Ale_ShowAlert (Ale_INFO,Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -861,7 +855,7 @@ void Pwd_ShowFormChgOtherUsrPwd (void)
/***** Show possible alert *****/
if (Gbl.Alert.Section == (const char *) Pwd_PASSWORD_SECTION_ID)
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt);
Ale_ShowDelayedAlert ();
/***** Form to change password *****/
/* Start form */
@ -942,7 +936,7 @@ bool Pwd_GetConfirmationOnDangerousAction (void)
/***** Get if consent has been done *****/
if (!Par_GetParToBool ("Consent"))
{
Ale_ShowA_old (Ale_WARNING,Txt_You_have_not_confirmed_the_action);
Ale_ShowAlert (Ale_WARNING,Txt_You_have_not_confirmed_the_action);
return false;
}
@ -956,7 +950,7 @@ bool Pwd_GetConfirmationOnDangerousAction (void)
/* Compare passwords */
if (strcmp (Gbl.Usrs.Me.LoginEncryptedPassword,EncryptedPassword))
{
Ale_ShowA_old (Ale_WARNING,Txt_You_have_not_entered_your_password_correctly);
Ale_ShowAlert (Ale_WARNING,Txt_You_have_not_entered_your_password_correctly);
return false;
}

View File

@ -331,7 +331,7 @@ static void Pho_ReqPhoto (const struct UsrData *UsrDat)
}
/***** Show help message *****/
Ale_ShowA_old (Ale_INFO,Txt_You_can_send_a_file_with_an_image_in_JPEG_format_);
Ale_ShowAlert (Ale_INFO,Txt_You_can_send_a_file_with_an_image_in_JPEG_format_);
/***** Form to upload photo *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -375,10 +375,10 @@ void Pho_SendPhotoUsr (void)
Pho_ReqOtherUsrPhoto ();
}
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
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_);
}
/*****************************************************************************/
@ -417,7 +417,7 @@ void Pho_RecOtherUsrPhotoDetFaces (void)
Rec_ShowPublicSharedRecordOtherUsr ();
}
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_);
}
/*****************************************************************************/
@ -446,7 +446,7 @@ void Pho_ReqRemoveMyPhoto (void)
Btn_REMOVE_BUTTON,Txt_Remove_photo);
}
else
Ale_ShowA_old (Ale_INFO,Txt_The_photo_no_longer_exists);
Ale_ShowAlert (Ale_INFO,Txt_The_photo_no_longer_exists);
/***** Show my record and other data *****/
Rec_ShowMySharedRecordAndMore ();
@ -529,13 +529,13 @@ void Pho_ReqRemoveUsrPhoto (void)
Btn_REMOVE_BUTTON,Txt_Remove_photo);
}
else
Ale_ShowA_old (Ale_INFO,Txt_The_photo_no_longer_exists);
Ale_ShowAlert (Ale_INFO,Txt_The_photo_no_longer_exists);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
/***** Show another user's record card *****/
Rec_ShowPublicSharedRecordOtherUsr ();
@ -560,7 +560,7 @@ void Pho_RemoveUsrPhoto (void)
Ale_ShowPendingAlert ();
}
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_);
/***** Show another user's record card *****/
Rec_ShowPublicSharedRecordOtherUsr ();
@ -649,10 +649,8 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
WrongType = true;
if (WrongType)
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_file_is_not_X,
"jpg");
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_WARNING,Txt_The_file_is_not_X,
"jpg");
return false;
}
@ -663,7 +661,7 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
Cfg_FOLDER_PHOTO_TMP,Gbl.UniqueNameEncrypted);
if (!Fil_EndReceptionOfFile (FileNamePhotoTmp,Param))
{
Ale_ShowA_old (Ale_WARNING,"Error copying file.");
Ale_ShowAlert (Ale_ERROR,"Error copying file.");
return false;
}
@ -881,7 +879,7 @@ void Pho_UpdateUsrPhoto1 (void)
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
Pho_UpdatePhoto1 (&Gbl.Usrs.Other.UsrDat);
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_);
}
void Pho_UpdateUsrPhoto2 (void)

View File

@ -601,7 +601,7 @@ void Plc_RemovePlace (void)
/***** Check if this place has centres *****/
if (Plc.NumCtrs) // Place has centres ==> don't remove
Ale_ShowA_old (Ale_WARNING,Txt_To_remove_a_place_you_must_first_remove_all_centres_of_that_place);
Ale_ShowAlert (Ale_WARNING,Txt_To_remove_a_place_you_must_first_remove_all_centres_of_that_place);
else // Place has no centres ==> remove it
{
/***** Remove place *****/
@ -610,10 +610,8 @@ void Plc_RemovePlace (void)
Plc.PlcCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Place_X_removed,
Plc.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_Place_X_removed,
Plc.FullName);
}
/***** Show the form again *****/
@ -685,12 +683,8 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewPlcName[0])
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_You_can_not_leave_the_name_of_the_place_X_empty,
CurrentPlcName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_place_X_empty,
CurrentPlcName);
else
{
/***** Check if old and new names are the same
@ -699,31 +693,21 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
{
/***** If place was in database... *****/
if (Plc_CheckIfPlaceNameExists (ParamName,NewPlcName,Plc->PlcCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_place_X_already_exists,
NewPlcName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_The_place_X_already_exists,
NewPlcName);
else
{
/* Update the table changing old name by new name */
Plc_UpdatePlcNameDB (Plc->PlcCod,FieldName,NewPlcName);
/* Write message to show the change made */
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_place_X_has_been_renamed_as_Y,
CurrentPlcName,NewPlcName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_place_X_has_been_renamed_as_Y,
CurrentPlcName,NewPlcName);
}
}
else // The same name
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_name_of_the_place_X_has_not_changed,
CurrentPlcName);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_place_X_has_not_changed,
CurrentPlcName);
}
/***** Show the form again *****/
@ -876,24 +860,16 @@ void Plc_RecFormNewPlace (void)
{
/***** If name of place was in database... *****/
if (Plc_CheckIfPlaceNameExists ("ShortName",Plc->ShrtName,-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_place_X_already_exists,
Plc->ShrtName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_The_place_X_already_exists,
Plc->ShrtName);
else if (Plc_CheckIfPlaceNameExists ("FullName",Plc->FullName,-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_place_X_already_exists,
Plc->FullName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_The_place_X_already_exists,
Plc->FullName);
else // Add new place to database
Plc_CreatePlace (Plc);
}
else // If there is not a place name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_place);
Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_place);
/***** Show the form again *****/
Plc_EditPlaces ();
@ -916,8 +892,6 @@ static void Plc_CreatePlace (struct Place *Plc)
Gbl.CurrentIns.Ins.InsCod,Plc->ShrtName,Plc->FullName);
/***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Created_new_place_X,
Plc->FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_place_X,
Plc->FullName);
}

View File

@ -86,7 +86,7 @@ void Plg_ListPlugins (void)
if (Gbl.Usrs.Me.Role.Logged != Rol_SYS_ADM)
{
Ale_ShowA_old (Ale_WARNING,Txt_Option_under_development);
Ale_ShowAlert (Ale_WARNING,Txt_Option_under_development);
return;
}
@ -502,10 +502,8 @@ void Plg_RemovePlugin (void)
Plg.PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Plugin_X_removed,
Plg.Name);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_Plugin_X_removed,
Plg.Name);
/***** Show the form again *****/
Plg_EditPlugins ();
@ -539,12 +537,8 @@ void Plg_RenamePlugin (void)
/***** Check if new name is empty *****/
if (!NewPlgName[0])
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
Plg->Name);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
Plg->Name);
else
{
/***** Check if old and new names are the same
@ -553,12 +547,8 @@ void Plg_RenamePlugin (void)
{
/***** If plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (NewPlgName,Plg->PlgCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_plugin_X_already_exists,
NewPlgName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_The_plugin_X_already_exists,
NewPlgName);
else
{
/* Update the table changing old name by new name */
@ -567,19 +557,13 @@ void Plg_RenamePlugin (void)
NewPlgName,Plg->PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_plugin_X_has_been_renamed_as_Y,
Plg->Name,NewPlgName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_plugin_X_has_been_renamed_as_Y,
Plg->Name,NewPlgName);
}
}
else // The same name
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_name_of_the_plugin_X_has_not_changed,
Plg->Name);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_INFO,Txt_The_name_of_the_plugin_X_has_not_changed,
Plg->Name);
}
/***** Show the form again *****/
@ -632,13 +616,11 @@ void Plg_ChangePlgDescription (void)
NewDescription,Plg->PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_description_is_X,
NewDescription);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_description_is_X,
NewDescription);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_description_empty);
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_description_empty);
/***** Show the form again *****/
Str_Copy (Plg->Description,NewDescription,
@ -676,13 +658,11 @@ void Plg_ChangePlgLogo (void)
NewLogo,Plg->PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_logo_is_X,
NewLogo);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_logo_is_X,
NewLogo);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_logo_empty);
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_logo_empty);
/***** Show the form again *****/
Str_Copy (Plg->Logo,NewLogo,
@ -720,13 +700,11 @@ void Plg_ChangePlgAppKey (void)
NewAppKey,Plg->PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NewAppKey);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NewAppKey);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_logo_empty); // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_logo_empty); // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/***** Show the form again *****/
Str_Copy (Plg->AppKey,NewAppKey,
@ -764,13 +742,11 @@ void Plg_ChangePlgURL (void)
NewURL,Plg->PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_URL_is_X,
NewURL);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_URL_is_X,
NewURL);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_URL_empty);
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_URL_empty);
/***** Show the form again *****/
Str_Copy (Plg->URL,NewURL,
@ -808,13 +784,11 @@ void Plg_ChangePlgIP (void)
NewIP,Plg->PlgCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_IP_address_is_X,
NewIP);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_The_new_IP_address_is_X,
NewIP);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_IP_address_empty);
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_IP_address_empty);
/***** Show the form again *****/
Str_Copy (Plg->IP,NewIP,
@ -1017,20 +991,16 @@ void Plg_RecFormNewPlg (void)
{
/***** If name of plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (Plg->Name,-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_plugin_X_already_exists,
Plg->Name);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowAlert (Ale_WARNING,Txt_The_plugin_X_already_exists,
Plg->Name);
else // Add new plugin to database
Plg_CreatePlugin (Plg);
}
else // If there is not a logo, a URL or a IP
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_logo_the_application_key_the_URL_and_the_IP_address_of_the_new_plugin);
Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_logo_the_application_key_the_URL_and_the_IP_address_of_the_new_plugin);
}
else // If there is not a plugin name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_name_and_the_description_of_the_new_plugin);
Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_name_and_the_description_of_the_new_plugin);
/***** Show the form again *****/
Plg_EditPlugins ();
@ -1056,10 +1026,8 @@ static void Plg_CreatePlugin (struct Plugin *Plg)
Plg->AppKey,Plg->URL,Plg->IP);
/***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Created_new_plugin_X,
Plg->Name);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_plugin_X,
Plg->Name);
}
/*****************************************************************************/

View File

@ -91,7 +91,7 @@ void Pri_EditMyPrivacy (void)
/***** If any of my preferences about privacy is unknown *****/
if (Gbl.Usrs.Me.UsrDat.PhotoVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.ProfileVisibility == Pri_VISIBILITY_UNKNOWN)
Ale_ShowA_old (Ale_WARNING,Txt_Please_review_your_privacy_preferences);
Ale_ShowAlert (Ale_WARNING,Txt_Please_review_your_privacy_preferences);
/***** Start box and table *****/
Box_StartBoxTable (NULL,Txt_Privacy,Pri_PutIconsPrivacy,

View File

@ -238,7 +238,7 @@ void Prf_GetUsrDatAndShowUserProfile (void)
if (!ProfileShown)
{
/* Show error message */
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_);
/* Request a user's profile */
Prf_RequestUserProfile ();