From d2a5992a70f1f7f79d1057f69cb956221f9f2281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 28 Apr 2017 10:35:41 +0200 Subject: [PATCH] Version 16.194.5 --- swad_account.c | 4 ++-- swad_assignment.c | 2 +- swad_changelog.h | 3 ++- swad_enrolment.c | 13 ++++++++----- swad_forum.c | 33 +++++++++++++++++++++------------ swad_layout.c | 7 ++++--- swad_layout.h | 3 ++- swad_message.c | 6 ++++-- swad_photo.c | 3 ++- 9 files changed, 46 insertions(+), 28 deletions(-) diff --git a/swad_account.c b/swad_account.c index 5d744e4f9..ad6ef2bf7 100644 --- a/swad_account.c +++ b/swad_account.c @@ -916,7 +916,7 @@ void Acc_AskIfRemoveMyAccount (void) Act_FormEnd (); /* End alert */ - Lay_ShowAlertAndButton2 (ActUnk,NULL,Lay_NO_BUTTON,NULL); + Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL); } static void Acc_AskIfRemoveOtherUsrAccount (void) @@ -942,7 +942,7 @@ static void Acc_AskIfRemoveOtherUsrAccount (void) Act_FormEnd (); /* End alert */ - Lay_ShowAlertAndButton2 (ActUnk,NULL,Lay_NO_BUTTON,NULL); + Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); diff --git a/swad_assignment.c b/swad_assignment.c index 4eac1d565..e1ee47ba0 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -917,7 +917,7 @@ void Asg_ReqRemAssignment (void) Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message); /* End alert */ - Lay_ShowAlertAndButton2 (ActRemAsg,Asg_PutParams, + Lay_ShowAlertAndButton2 (ActRemAsg,NULL,Asg_PutParams, Lay_REMOVE_BUTTON,Txt_Remove_assignment); /***** Show assignments again *****/ diff --git a/swad_changelog.h b/swad_changelog.h index 2e6157d79..b5259783b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -221,13 +221,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.194.4 (2017-04-28)" +#define Log_PLATFORM_VERSION "SWAD 16.194.5 (2017-04-28)" #define CSS_FILE "swad16.193.4.css" #define JS_FILE "swad16.181.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.194.5: Apr 28, 2017 Changed dialog to remove forum thread. (218347 lines) Version 16.194.4: Apr 28, 2017 Changed dialog to remove assignment. (218332 lines) Version 16.194.3: Apr 28, 2017 Changed dialog to remove all students in course. (218340 lines) Version 16.194.2: Apr 28, 2017 Changed dialog to reject user's enrolment request. (218336 lines) diff --git a/swad_enrolment.c b/swad_enrolment.c index b19d0a70d..3bbbb0e04 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -1773,7 +1773,7 @@ void Enr_AskRemAllStdsThisCrs (void) Act_FormEnd (); /* End alert */ - Lay_ShowAlertAndButton2 (ActUnk,NULL,Lay_NO_BUTTON,NULL); + Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL); } else /***** Show warning indicating no students found *****/ @@ -2063,7 +2063,8 @@ void Enr_AskIfRejectSignUp (void) Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); /* End alert */ - Lay_ShowAlertAndButton2 (ActRejSignUp,Usr_PutParamOtherUsrCodEncrypted, + Lay_ShowAlertAndButton2 (ActRejSignUp,NULL, + Usr_PutParamOtherUsrCodEncrypted, Lay_REMOVE_BUTTON,Txt_Reject); } else @@ -3521,7 +3522,8 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName) Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); /* End alert */ - Lay_ShowAlertAndButton2 (Enr_ActNewAdm[Scope],Usr_PutParamOtherUsrCodEncrypted, + Lay_ShowAlertAndButton2 (Enr_ActNewAdm[Scope],NULL, + Usr_PutParamOtherUsrCodEncrypted, Lay_CREATE_BUTTON,Txt_Register_user_IN_A_COURSE_OR_DEGREE); } } @@ -3910,7 +3912,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat,bool ItsMe) Act_FormEnd (); /* End alert */ - Lay_ShowAlertAndButton2 (ActUnk,NULL,Lay_NO_BUTTON,NULL); + Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); @@ -4010,7 +4012,8 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,const char *InsCtrDegN Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat); /* End alert */ - Lay_ShowAlertAndButton2 (Enr_ActRemAdm[Scope],Usr_PutParamOtherUsrCodEncrypted, + Lay_ShowAlertAndButton2 (Enr_ActRemAdm[Scope],NULL, + Usr_PutParamOtherUsrCodEncrypted, Lay_REMOVE_BUTTON, ItsMe ? Txt_Remove_me_as_an_administrator : Txt_Remove_USER_as_an_administrator); diff --git a/swad_forum.c b/swad_forum.c index 79d7f3f5f..4fbdad600 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -364,6 +364,8 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject); static void For_UpdateNumUsrsNotifiedByEMailAboutPost (long PstCod,unsigned NumUsrsToBeNotifiedByEMail); +static void For_PutAllHiddenParamsRemThread (void); + static bool For_CheckIfICanMoveThreads (void); static long For_GetThrInMyClipboard (void); static bool For_CheckIfThrBelongsToForum (long ThrCod,struct Forum *Forum); @@ -4114,18 +4116,32 @@ void For_RequestRemoveThread (void) /***** Show forum list again *****/ For_ShowForumList (); - /***** Request confirmation to remove the thread *****/ + /***** Show question and button to remove the thread *****/ + /* Start alert */ fprintf (Gbl.F.Out,"
",For_ID_REMOVE_THREAD_SECTION); if (Subject[0]) { sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_entire_thread_X, Subject); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message); } else - Lay_ShowAlert (Lay_WARNING,Txt_Do_you_really_want_to_remove_the_entire_thread); - Act_FormStartAnchor (For_ActionsDelThrFor[Gbl.Forum.ForumSelected.Type], - For_ID_FORUM_THREADS_SECTION); + Lay_ShowAlertAndButton1 (Lay_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread); + + /* End alert */ + Lay_ShowAlertAndButton2 (For_ActionsDelThrFor[Gbl.Forum.ForumSelected.Type], + For_ID_FORUM_THREADS_SECTION, + For_PutAllHiddenParamsRemThread, + Lay_REMOVE_BUTTON,Txt_Remove_thread); + fprintf (Gbl.F.Out,"
"); + + /***** Show the threads again *****/ + For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod, + Lay_SUCCESS,NULL); + } + +static void For_PutAllHiddenParamsRemThread (void) + { For_PutAllHiddenParamsForum (Gbl.Forum.CurrentPageThrs, // Page of threads = current 1, // Page of posts = first Gbl.Forum.ForumSet, @@ -4133,13 +4149,6 @@ void For_RequestRemoveThread (void) Gbl.Forum.ForumSelected.Location, Gbl.Forum.ForumSelected.ThrCod, -1L); - Lay_PutRemoveButton (Txt_Remove_thread); - Act_FormEnd (); - fprintf (Gbl.F.Out,""); - - /***** Show the threads again *****/ - For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod, - Lay_SUCCESS,NULL); } /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index aac5ce7fd..4df2393bb 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1588,7 +1588,7 @@ void Lay_ShowErrorAndExit (const char *Message) void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message) { Lay_ShowAlertAndButton1 (AlertType,Message); - Lay_ShowAlertAndButton2 (ActUnk,NULL,Lay_NO_BUTTON,NULL); + Lay_ShowAlertAndButton2 (ActUnk,NULL,NULL,Lay_NO_BUTTON,NULL); } void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message) @@ -1610,7 +1610,8 @@ void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message) fprintf (Gbl.F.Out,""); } -void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,void (*FuncParams) (), +void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor, + void (*FuncParams) (), Lay_Button_t Button,const char *TxtButton) { /***** Optional button *****/ @@ -1620,7 +1621,7 @@ void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,void (*FuncParams) (), if (TxtButton[0]) { /* Start form */ - Act_FormStart (NextAction); + Act_FormStartAnchor (NextAction,Anchor); if (FuncParams) FuncParams (); diff --git a/swad_layout.h b/swad_layout.h index 8bc5bb0ff..c1e47efde 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -120,7 +120,8 @@ void Lay_EndRoundFrame (void); void Lay_ShowErrorAndExit (const char *Message); void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message); void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message); -void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,void (*FuncParams) (), +void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor, + void (*FuncParams) (), Lay_Button_t Button,const char *TxtButton); void Lay_RefreshNotifsAndConnected (void); diff --git a/swad_message.c b/swad_message.c index bc51d6a84..627bd1928 100644 --- a/swad_message.c +++ b/swad_message.c @@ -891,7 +891,8 @@ void Msg_ReqDelAllRecMsgs (void) Msg_ShowSentOrReceivedMessages (); /* End alert */ - Lay_ShowAlertAndButton2 (ActDelAllRcvMsg,Msg_PutHiddenParamsMsgsFilters, + Lay_ShowAlertAndButton2 (ActDelAllRcvMsg,NULL, + Msg_PutHiddenParamsMsgsFilters, Lay_REMOVE_BUTTON,Txt_Delete_messages_received); } @@ -930,7 +931,8 @@ void Msg_ReqDelAllSntMsgs (void) Msg_ShowSentOrReceivedMessages (); /* End alert */ - Lay_ShowAlertAndButton2 (ActDelAllSntMsg,Msg_PutHiddenParamsMsgsFilters, + Lay_ShowAlertAndButton2 (ActDelAllSntMsg,NULL, + Msg_PutHiddenParamsMsgsFilters, Lay_REMOVE_BUTTON,Txt_Delete_messages_sent); } diff --git a/swad_photo.c b/swad_photo.c index 72681d9f5..d3770e9cc 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -423,7 +423,8 @@ void Pho_ReqRemoveMyPhoto (void) fprintf (Gbl.F.Out,""); /* End alert */ - Lay_ShowAlertAndButton2 (ActRemMyPho,NULL,Lay_REMOVE_BUTTON,Txt_Remove_photo); + Lay_ShowAlertAndButton2 (ActRemMyPho,NULL,NULL, + Lay_REMOVE_BUTTON,Txt_Remove_photo); } else Lay_ShowAlert (Lay_INFO,Txt_The_photo_no_longer_exists);