From ae0b97aa9624844f33e7089d4f1e4989604e3b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 11 Apr 2016 02:16:27 +0200 Subject: [PATCH] Version 15.192.3 --- swad_action.c | 50 ++++++++++++++++++++++++------------------------ swad_changelog.h | 3 ++- swad_forum.c | 7 +++++++ swad_message.c | 6 ++++++ 4 files changed, 40 insertions(+), 26 deletions(-) diff --git a/swad_action.c b/swad_action.c index cbcbdd27c..08751350f 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2409,31 +2409,31 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActSeePstForSWAUsr*/{ 244,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_ShowThrPsts ,NULL}, /* ActSeePstForSWATch*/{ 246,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_ShowThrPsts ,NULL}, - /* ActRcvThrForCrsUsr*/{ 350,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForCrsTch*/{ 754,-1,TabSoc,ActSeeFor ,0x114,0x114,0x114,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForDegUsr*/{ 252,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForDegTch*/{ 247,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForCtrUsr*/{ 903,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForCtrTch*/{ 904,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForInsUsr*/{ 737,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForInsTch*/{ 769,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForGenUsr*/{ 736,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForGenTch*/{ 765,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForSWAUsr*/{ 258,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvThrForSWATch*/{ 259,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForCrsUsr*/{ 350,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForCrsTch*/{ 754,-1,TabSoc,ActSeeFor ,0x114,0x114,0x114,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForDegUsr*/{ 252,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForDegTch*/{ 247,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForCtrUsr*/{ 903,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForCtrTch*/{ 904,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForInsUsr*/{ 737,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForInsTch*/{ 769,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForGenUsr*/{ 736,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForGenTch*/{ 765,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForSWAUsr*/{ 258,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvThrForSWATch*/{ 259,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForCrsUsr*/{ 599,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForCrsTch*/{ 755,-1,TabSoc,ActSeeFor ,0x114,0x114,0x114,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForDegUsr*/{ 606,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForDegTch*/{ 617,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForCtrUsr*/{ 905,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForCtrTch*/{ 906,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForInsUsr*/{ 740,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForInsTch*/{ 770,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForGenUsr*/{ 747,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForGenTch*/{ 816,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForSWAUsr*/{ 603,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, - /* ActRcvRepForSWATch*/{ 622,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForCrsUsr*/{ 599,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForCrsTch*/{ 755,-1,TabSoc,ActSeeFor ,0x114,0x114,0x114,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForDegUsr*/{ 606,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForDegTch*/{ 617,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForCtrUsr*/{ 905,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForCtrTch*/{ 906,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForInsUsr*/{ 740,-1,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForInsTch*/{ 770,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForGenUsr*/{ 747,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForGenTch*/{ 816,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForSWAUsr*/{ 603,-1,TabSoc,ActSeeFor ,0x1FE,0x1FE,0x1FE,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, + /* ActRcvRepForSWATch*/{ 622,-1,TabSoc,ActSeeFor ,0x1F4,0x1F4,0x1F4,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,For_RecForumPst ,NULL}, /* ActReqDelThrCrsUsr*/{ 867,-1,TabSoc,ActSeeFor ,0x114,0x114,0x114,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_ReqDelThr ,NULL}, /* ActReqDelThrCrsTch*/{ 869,-1,TabSoc,ActSeeFor ,0x114,0x114,0x114,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_ReqDelThr ,NULL}, @@ -2556,7 +2556,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActSeeNewNtf */{ 991,-1,TabMsg,ActSeeNtf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ntf_ShowMyNotifications ,NULL}, /* ActMrkNtfSee */{1146,-1,TabMsg,ActSeeNtf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ntf_MarkAllNotifAsSeen ,NULL}, - /* ActRcvMsgUsr */{ 27,-1,TabMsg,ActReqMsgUsr ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Msg_RecMsgFromUsr ,NULL}, + /* ActRcvMsgUsr */{ 27,-1,TabMsg,ActReqMsgUsr ,0x1FC,0x1FC,0x1FC,Act_CONTENT_DATA,Act_MAIN_WINDOW,NULL ,Msg_RecMsgFromUsr ,NULL}, /* ActReqDelAllSntMsg*/{ 604,-1,TabMsg,ActSeeSntMsg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Msg_ReqDelAllSntMsgs ,NULL}, /* ActReqDelAllRcvMsg*/{ 593,-1,TabMsg,ActSeeRcvMsg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Msg_ReqDelAllRecMsgs ,NULL}, /* ActDelAllSntMsg */{ 434,-1,TabMsg,ActSeeSntMsg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Msg_DelAllSntMsgs ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index eccc21838..ffb350c07 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -133,13 +133,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.192.2 (2016-04-11)" +#define Log_PLATFORM_VERSION "SWAD 15.192.3 (2016-04-11)" #define CSS_FILE "swad15.192.css" #define JS_FILE "swad15.190.1.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 15.192.3: Apr 11, 2016 Fixed bugs when receiving forum image. (199355 lines) Version 15.192.2: Apr 11, 2016 Fixed bug when getting forum post content. (199344 lines) Version 15.192.1: Apr 10, 2016 Remove image attached to forum post when the post is removed. (199340 lines) Version 15.192: Apr 10, 2016 Get image attached to forum post / message. (199332 lines) diff --git a/swad_forum.c b/swad_forum.c index a9764e7a5..cf8e88c26 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -457,6 +457,12 @@ static long For_InsertForumPst (long ThrCod,long UsrCod, Img_MAX_BYTES_TITLE)) == NULL) Lay_ShowErrorAndExit ("Not enough memory to store database query."); + /***** Check if image is received and processed *****/ + if (Image->Action == Img_ACTION_NEW_IMAGE && // Upload new image + Image->Status == Img_FILE_PROCESSED) // The new image received has been processed + /* Move processed image to definitive directory */ + Img_MoveImageToDefinitiveDirectory (Image); + /***** Insert forum post in the database *****/ sprintf (Query,"INSERT INTO forum_post" " (ThrCod,UsrCod,CreatTime,ModifTime,NumNotif," @@ -1161,6 +1167,7 @@ static void For_ShowAForumPost (struct ForumThread *Thr,unsigned PstNum,long Pst /***** Get data of post *****/ For_GetPstData (PstCod,&UsrDat.UsrCod,&CreatTimeUTC, Subject,OriginalContent,&Image); + if (Enabled) { /* Return this subject as last subject */ diff --git a/swad_message.c b/swad_message.c index 59613375d..1120b2323 100644 --- a/swad_message.c +++ b/swad_message.c @@ -1371,6 +1371,12 @@ static long Msg_InsertNewMsg (const char *Subject,const char *Content, Img_MAX_BYTES_TITLE)) == NULL) Lay_ShowErrorAndExit ("Not enough memory to store database query."); + /***** Check if image is received and processed *****/ + if (Image->Action == Img_ACTION_NEW_IMAGE && // Upload new image + Image->Status == Img_FILE_PROCESSED) // The new image received has been processed + /* Move processed image to definitive directory */ + Img_MoveImageToDefinitiveDirectory (Image); + /***** Insert message subject and content in the database *****/ sprintf (Query,"INSERT INTO msg_content" " (Subject,Content,ImageName,ImageTitle)"