diff --git a/css/swad16.201.css b/css/swad16.201.css index ea50f63ef..402325858 100644 --- a/css/swad16.201.css +++ b/css/swad16.201.css @@ -1546,7 +1546,7 @@ a:hover /* Default ==> underlined */ .CONTEXT_COL { width:36px; - text-align:left; + text-align:center; vertical-align:top; } diff --git a/swad_changelog.h b/swad_changelog.h index d2efea7f0..65ce8d45f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -222,13 +222,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.201.1 (2017-05-02)" +#define Log_PLATFORM_VERSION "SWAD 16.201.2 (2017-05-02)" #define CSS_FILE "swad16.201.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.201.2: May 02, 2017 Code refactoring in messages. (218242 lines) Version 16.201.1: May 02, 2017 Code refactoring in messages. (218241 lines) Version 16.201: May 02, 2017 Change layout of contextual icons in assignments, surveys and attendance. (218344 lines) Version 16.200.1: May 02, 2017 Fixed problem printing view of students, teachers and guests. (218331 lines) diff --git a/swad_global.h b/swad_global.h index 980c99f84..83fc33725 100644 --- a/swad_global.h +++ b/swad_global.h @@ -621,6 +621,7 @@ struct Globals char FileNameMail[PATH_MAX + 1]; FILE *FileMail; unsigned CurrentPage; + long MsgCod; // Used as parameter with message to be removed } Msg; struct { diff --git a/swad_message.c b/swad_message.c index 2845fba0c..c1ba5b9da 100644 --- a/swad_message.c +++ b/swad_message.c @@ -93,6 +93,7 @@ static void Msg_ConstructQueryToSelectSentOrReceivedMsgs (char Query[Msg_MAX_BYT static char *Msg_WriteNumMsgs (unsigned NumUnreadMsgs); static void Msg_PutIconsListMsgs (void); +static void Msg_PutHiddenParamsOneMsg (void); static void Msg_ShowFormToShowOnlyUnreadMessages (void); static void Msg_GetParamOnlyUnreadMsgs (void); @@ -142,8 +143,6 @@ static void Msg_WriteFormToReply (long MsgCod,long CrsCod, static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted); static void Msg_WriteMsgTo (long MsgCod); -static void Msg_PutFormToDeleteMessage (long MsgCod); - static void Msg_PutFormToBanSender (struct UsrData *UsrDat); static void Msg_PutFormToUnbanSender (struct UsrData *UsrDat); static void Msg_UnbanSender (void); @@ -1697,22 +1696,22 @@ static void Msg_ShowSentOrReceivedMessages (void) static const Act_Action_t ActionSee[Msg_NUM_TYPES_OF_MSGS] = { ActSeeRcvMsg, - ActSeeSntMsg + ActSeeSntMsg, }; static const Pag_WhatPaginate_t WhatPaginate[Msg_NUM_TYPES_OF_MSGS] = { Pag_MESSAGES_RECEIVED, - Pag_MESSAGES_SENT + Pag_MESSAGES_SENT, }; const char *Help[Msg_NUM_TYPES_OF_MSGS] = { Hlp_MESSAGES_Received, - Hlp_MESSAGES_Sent + Hlp_MESSAGES_Sent, }; const char *HelpFilter[Msg_NUM_TYPES_OF_MSGS] = { Hlp_MESSAGES_Received_filter, - Hlp_MESSAGES_Sent_filter + Hlp_MESSAGES_Sent_filter, }; /***** Get the page number *****/ @@ -2406,9 +2405,14 @@ static char *Msg_WriteNumMsgs (unsigned NumUnreadMsgs) static void Msg_PutIconsListMsgs (void) { - /***** Put icons to remove messages *****/ - Lay_PutContextualIconToRemove ((Gbl.Msg.TypeOfMessages == Msg_MESSAGES_RECEIVED) ? ActReqDelAllRcvMsg : - ActReqDelAllSntMsg, + static const Act_Action_t ActionReqDelAllMsg[Msg_NUM_TYPES_OF_MSGS] = + { + ActReqDelAllRcvMsg, + ActReqDelAllSntMsg, + }; + + /***** Put icon to remove messages *****/ + Lay_PutContextualIconToRemove (ActionReqDelAllMsg[Gbl.Msg.TypeOfMessages], Msg_PutHiddenParamsMsgsFilters); /***** Put icon to show a figure *****/ @@ -2417,7 +2421,19 @@ static void Msg_PutIconsListMsgs (void) } /*****************************************************************************/ -/***** Write a form parameter to specify filter "from"/"to" for messages *****/ +/******* Put hidden parameters to expand, contract or delete a message *******/ +/*****************************************************************************/ + +static void Msg_PutHiddenParamsOneMsg (void) + { + Pag_PutHiddenParamPagNum (Msg_WhatPaginate[Gbl.Msg.TypeOfMessages], + Gbl.Msg.CurrentPage); + Msg_PutHiddenParamMsgCod (Gbl.Msg.MsgCod); + Msg_PutHiddenParamsMsgsFilters (); + } + +/*****************************************************************************/ +/****************** Put hidden parameters with filters ***********************/ /*****************************************************************************/ void Msg_PutHiddenParamsMsgsFilters (void) @@ -2814,6 +2830,11 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) extern const char *Txt_MSG_From; extern const char *Txt_MSG_To; extern const char *Txt_MSG_Content; + static const Act_Action_t ActionDelMsg[Msg_NUM_TYPES_OF_MSGS] = + { + ActDelRcvMsg, + ActDelSntMsg, + }; struct UsrData UsrDat; const char *Title = NULL; // Initialized to avoid warning bool FromThisCrs = false; // Initialized to avoid warning @@ -2856,7 +2877,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) } fprintf (Gbl.F.Out,"