mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-10 10:45:23 +02:00
Version 15.93.5
This commit is contained in:
parent
f69f790d7e
commit
d665a38ab6
|
@ -924,7 +924,7 @@ CREATE TABLE IF NOT EXISTS social_notes (
|
|||
Unavailable ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
TimeNote DATETIME NOT NULL,
|
||||
UNIQUE INDEX(NotCod),
|
||||
INDEX(SocialNote),
|
||||
UNIQUE INDEX(NoteType,Cod),
|
||||
INDEX(UsrCod),
|
||||
INDEX(TimeNote));
|
||||
--
|
||||
|
|
|
@ -118,13 +118,22 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.93.4 (2016-01-03)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.93.5 (2016-01-03)"
|
||||
#define CSS_FILE "swad15.88.1.css"
|
||||
#define JS_FILE "swad15.77.7.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.93.5: Jan 03, 2016 Social notes are marked as unavailable when a notice is removed. (190406 lines)
|
||||
6 changes necessary in database:
|
||||
CREATE UNIQUE INDEX NotCod ON social_notes (NotCod);
|
||||
DROP INDEX SocCod ON social_notes;
|
||||
DROP INDEX TimeEvent ON social_notes;
|
||||
CREATE INDEX TimeNote ON social_notes (TimeNote);
|
||||
DROP INDEX SocialEvent ON social_notes;
|
||||
CREATE UNIQUE INDEX NoteTypeCod ON social_notes (NoteType,Cod);
|
||||
|
||||
Version 15.93.4: Jan 03, 2016 Changes in links to actions in social timeline.
|
||||
New field Unavailable in table of social notes. (190354 lines)
|
||||
1 change necessary in database:
|
||||
|
|
|
@ -1960,7 +1960,7 @@ mysql> DESCRIBE social_notes;
|
|||
"Unavailable ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"TimeNote DATETIME NOT NULL,"
|
||||
"UNIQUE INDEX(NotCod),"
|
||||
"INDEX(NoteType),"
|
||||
"UNIQUE INDEX(NoteType,Cod),"
|
||||
"INDEX(UsrCod),"
|
||||
"INDEX(TimeNote))");
|
||||
|
||||
|
|
|
@ -332,6 +332,9 @@ void Not_RemoveNotice (void)
|
|||
/***** Mark possible notifications as removed *****/
|
||||
Ntf_SetNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod);
|
||||
|
||||
/***** Mark possible social note as unavailable *****/
|
||||
Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NOTE_NOTICE,NotCod);
|
||||
|
||||
/***** Update RSS of current course *****/
|
||||
RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs);
|
||||
}
|
||||
|
|
|
@ -818,7 +818,7 @@ void Ntf_GetNotifSummaryAndContent (char *SummaryStr,char **ContentStr,Ntf_Notif
|
|||
|
||||
void Ntf_SetNotifAsSeen (Ntf_NotifyEvent_t NotifyEvent,long Cod,long ToUsrCod)
|
||||
{
|
||||
char Query[512];
|
||||
char Query[256];
|
||||
|
||||
/***** Set notification as seen by me *****/
|
||||
if (ToUsrCod > 0) // If the user code is specified
|
||||
|
|
|
@ -132,11 +132,11 @@ extern struct Globals Gbl;
|
|||
static void Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction);
|
||||
static void Soc_GetDataOfSocialPublishingFromRow (MYSQL_ROW row,struct SocialPublishing *SocPub);
|
||||
static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
|
||||
const struct SocialNote *SocNot,
|
||||
struct SocialNote *SocNot,
|
||||
bool WritingTimeline,bool LastInList);
|
||||
static void Soc_WriteNoteDate (time_t TimeUTC);
|
||||
static void Soc_GetAndWriteSocialPost (long PstCod);
|
||||
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot,long CrsCod);
|
||||
static void Soc_PutFormGoToAction (struct SocialNote *SocNot,long CrsCod);
|
||||
static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
|
||||
char *SummaryStr,unsigned MaxChars);
|
||||
static void Soc_PublishSocialNoteInTimeline (struct SocialPublishing *SocPub);
|
||||
|
@ -344,9 +344,11 @@ static void Soc_GetDataOfSocialPublishingFromRow (MYSQL_ROW row,struct SocialPub
|
|||
/*****************************************************************************/
|
||||
/***************************** Write social note *****************************/
|
||||
/*****************************************************************************/
|
||||
// Pointer SocNot is not const because the field Unavailable...
|
||||
// ...can be marked as true inside this function
|
||||
|
||||
static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
|
||||
const struct SocialNote *SocNot,
|
||||
struct SocialNote *SocNot,
|
||||
bool WritingTimeline,bool LastInList)
|
||||
{
|
||||
extern const char *Txt_Forum;
|
||||
|
@ -608,7 +610,7 @@ static void Soc_GetAndWriteSocialPost (long PstCod)
|
|||
/********* Put form to go to an action depending on the social note **********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot,long CrsCod)
|
||||
static void Soc_PutFormGoToAction (struct SocialNote *SocNot,long CrsCod)
|
||||
{
|
||||
extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM];
|
||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
|
@ -620,6 +622,16 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot,long CrsCod)
|
|||
long DegCod = -1L;
|
||||
long GrpCod = -1L;
|
||||
|
||||
if (SocNot->Unavailable || // File/notice... pointer by this social note is unavailable
|
||||
Gbl.InsideForm) // Inside another form
|
||||
{
|
||||
/***** Do not put form *****/
|
||||
fprintf (Gbl.F.Out,"%s",Txt_SOCIAL_NOTE[SocNot->NoteType]);
|
||||
if (SocNot->Unavailable)
|
||||
fprintf (Gbl.F.Out," (%s)",Txt_not_available);
|
||||
}
|
||||
else // Not inside another form
|
||||
{
|
||||
/***** Parameters depending on the type of note *****/
|
||||
switch (SocNot->NoteType)
|
||||
{
|
||||
|
@ -644,6 +656,11 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot,long CrsCod)
|
|||
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
|
||||
Brw_PutHiddenParamFilCod (FileMetadata.FilCod);
|
||||
}
|
||||
else
|
||||
{
|
||||
Soc_MarkSocialNoteAsUnavailableUsingNotCod (SocNot->NotCod);
|
||||
SocNot->Unavailable = true;
|
||||
}
|
||||
break;
|
||||
case Soc_NOTE_NOTICE:
|
||||
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
|
||||
|
@ -658,7 +675,10 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot,long CrsCod)
|
|||
break;
|
||||
}
|
||||
|
||||
if (Gbl.InsideForm)
|
||||
if (SocNot->Unavailable)
|
||||
fprintf (Gbl.F.Out,"%s (%s)",
|
||||
Txt_SOCIAL_NOTE[SocNot->NoteType],Txt_not_available);
|
||||
else
|
||||
{
|
||||
/***** Parameter to go to another place in hierarchy *****/
|
||||
if (CrsCod > 0) // Course specified
|
||||
|
@ -688,9 +708,7 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot,long CrsCod)
|
|||
fprintf (Gbl.F.Out,"%s</a>",Txt_SOCIAL_NOTE[SocNot->NoteType]);
|
||||
Act_FormEnd ();
|
||||
}
|
||||
else // Not inside a form
|
||||
fprintf (Gbl.F.Out,"%s (%s)",
|
||||
Txt_SOCIAL_NOTE[SocNot->NoteType],Txt_not_available);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -779,6 +797,32 @@ void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod)
|
|||
Soc_PublishSocialNoteInTimeline (&SocPub);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Mark a social note as unavailable ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Soc_MarkSocialNoteAsUnavailableUsingNotCod (long NotCod)
|
||||
{
|
||||
char Query[256];
|
||||
|
||||
/***** Mark the social note as unavailable *****/
|
||||
sprintf (Query,"UPDATE social_notes SET Unavailable='Y'"
|
||||
" WHERE NotCod='%ld'",
|
||||
NotCod);
|
||||
DB_QueryUPDATE (Query,"can not mark social note as unavailable");
|
||||
}
|
||||
|
||||
void Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NoteType_t NoteType,long Cod)
|
||||
{
|
||||
char Query[256];
|
||||
|
||||
/***** Mark the social note as unavailable *****/
|
||||
sprintf (Query,"UPDATE social_notes SET Unavailable='Y'"
|
||||
" WHERE NoteType='%u' AND Cod='%ld'",
|
||||
(unsigned) NoteType,Cod);
|
||||
DB_QueryUPDATE (Query,"can not mark social note as unavailable");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Put contextual link to write a new post *******************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1282,6 +1326,8 @@ static void Soc_RequestRemovalSocialPublishing (void)
|
|||
else
|
||||
Act_FormStart (ActRemSocPubGbl);
|
||||
Soc_PutHiddenParamPubCod (SocPub.PubCod);
|
||||
|
||||
/* Warning message */
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_Do_you_really_want_to_remove_the_following_comment);
|
||||
|
||||
/* Show social note */
|
||||
|
|
|
@ -85,6 +85,8 @@ void Soc_ShowTimelineUsr (void);
|
|||
void Soc_ShowTimelineGbl (void);
|
||||
|
||||
void Soc_StoreAndPublishSocialNote (Soc_NoteType_t NoteType,long Cod);
|
||||
void Soc_MarkSocialNoteAsUnavailableUsingNotCod (long NotCod);
|
||||
void Soc_MarkSocialNoteAsUnavailableUsingNoteTypeAndCod (Soc_NoteType_t NoteType,long Cod);
|
||||
|
||||
void Soc_FormSocialPostGbl (void);
|
||||
void Soc_FormSocialPostUsr (void);
|
||||
|
|
Loading…
Reference in New Issue
Block a user