mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-08 17:55:24 +02:00
Version 15.94.1
This commit is contained in:
parent
a11f47b937
commit
fef9a3679b
|
@ -117,13 +117,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.94 (2016-01-04)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.94.1 (2016-01-04)"
|
||||
#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.94.1: Jan 04, 2016 Changes when writing an unavailable social note. (190557 lines)
|
||||
Version 15.94: Jan 04, 2016 Social notes are marked as unavailable when a folder and its children are removed. (190551 lines)
|
||||
Version 15.93.8: Jan 04, 2016 Social note is marked as unavailable when a public file is removed. (190486 lines)
|
||||
Version 15.93.7: Jan 03, 2016 Social note is marked as unavailable when a public forum post is removed. (190419 lines)
|
||||
|
|
173
swad_social.c
173
swad_social.c
|
@ -416,94 +416,96 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
|
|||
else
|
||||
{
|
||||
/* Get location in hierarchy */
|
||||
switch (SocNot->NoteType)
|
||||
{
|
||||
case Soc_NOTE_INS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_INS_SHA_PUB_FILE:
|
||||
/* Get institution data */
|
||||
Ins.InsCod = SocNot->HieCod;
|
||||
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
|
||||
break;
|
||||
case Soc_NOTE_CTR_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CTR_SHA_PUB_FILE:
|
||||
/* Get centre data */
|
||||
Ctr.CtrCod = SocNot->HieCod;
|
||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||
break;
|
||||
case Soc_NOTE_DEG_DOC_PUB_FILE:
|
||||
case Soc_NOTE_DEG_SHA_PUB_FILE:
|
||||
/* Get degree data */
|
||||
Deg.DegCod = SocNot->HieCod;
|
||||
Deg_GetDataOfDegreeByCod (&Deg);
|
||||
break;
|
||||
case Soc_NOTE_CRS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CRS_SHA_PUB_FILE:
|
||||
case Soc_NOTE_EXAM_ANNOUNCEMENT:
|
||||
case Soc_NOTE_NOTICE:
|
||||
/* Get course data */
|
||||
Crs.CrsCod = SocNot->HieCod;
|
||||
Crs_GetDataOfCourseByCod (&Crs);
|
||||
break;
|
||||
case Soc_NOTE_FORUM_POST:
|
||||
/* Get forum type of the post */
|
||||
Gbl.Forum.ForumType = For_GetForumTypeOfAPost (SocNot->Cod);
|
||||
For_SetForumName (Gbl.Forum.ForumType,
|
||||
&Ins,
|
||||
&Ctr,
|
||||
&Deg,
|
||||
&Crs,
|
||||
ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language
|
||||
Gbl.Forum.Ins.InsCod = Ins.InsCod;
|
||||
Gbl.Forum.Ctr.CtrCod = Ctr.CtrCod;
|
||||
Gbl.Forum.Deg.DegCod = Deg.DegCod;
|
||||
Gbl.Forum.Crs.CrsCod = Crs.CrsCod;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!SocNot->Unavailable)
|
||||
switch (SocNot->NoteType)
|
||||
{
|
||||
case Soc_NOTE_INS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_INS_SHA_PUB_FILE:
|
||||
/* Get institution data */
|
||||
Ins.InsCod = SocNot->HieCod;
|
||||
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
|
||||
break;
|
||||
case Soc_NOTE_CTR_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CTR_SHA_PUB_FILE:
|
||||
/* Get centre data */
|
||||
Ctr.CtrCod = SocNot->HieCod;
|
||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||
break;
|
||||
case Soc_NOTE_DEG_DOC_PUB_FILE:
|
||||
case Soc_NOTE_DEG_SHA_PUB_FILE:
|
||||
/* Get degree data */
|
||||
Deg.DegCod = SocNot->HieCod;
|
||||
Deg_GetDataOfDegreeByCod (&Deg);
|
||||
break;
|
||||
case Soc_NOTE_CRS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CRS_SHA_PUB_FILE:
|
||||
case Soc_NOTE_EXAM_ANNOUNCEMENT:
|
||||
case Soc_NOTE_NOTICE:
|
||||
/* Get course data */
|
||||
Crs.CrsCod = SocNot->HieCod;
|
||||
Crs_GetDataOfCourseByCod (&Crs);
|
||||
break;
|
||||
case Soc_NOTE_FORUM_POST:
|
||||
/* Get forum type of the post */
|
||||
Gbl.Forum.ForumType = For_GetForumTypeOfAPost (SocNot->Cod);
|
||||
For_SetForumName (Gbl.Forum.ForumType,
|
||||
&Ins,
|
||||
&Ctr,
|
||||
&Deg,
|
||||
&Crs,
|
||||
ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language
|
||||
Gbl.Forum.Ins.InsCod = Ins.InsCod;
|
||||
Gbl.Forum.Ctr.CtrCod = Ctr.CtrCod;
|
||||
Gbl.Forum.Deg.DegCod = Deg.DegCod;
|
||||
Gbl.Forum.Crs.CrsCod = Crs.CrsCod;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Write note type */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">");
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
Soc_PutFormGoToAction (SocNot,Crs.CrsCod);
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* Write location in hierarchy */
|
||||
switch (SocNot->NoteType)
|
||||
{
|
||||
case Soc_NOTE_INS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_INS_SHA_PUB_FILE:
|
||||
/* Write location (institution) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Institution,Ins.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_CTR_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CTR_SHA_PUB_FILE:
|
||||
/* Write location (centre) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Centre,Ctr.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_DEG_DOC_PUB_FILE:
|
||||
case Soc_NOTE_DEG_SHA_PUB_FILE:
|
||||
/* Write location (degree) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Degree,Deg.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_CRS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CRS_SHA_PUB_FILE:
|
||||
case Soc_NOTE_EXAM_ANNOUNCEMENT:
|
||||
case Soc_NOTE_NOTICE:
|
||||
/* Write location (course) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Course,Crs.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_FORUM_POST:
|
||||
/* Write forum name */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Forum,ForumName);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!SocNot->Unavailable)
|
||||
switch (SocNot->NoteType)
|
||||
{
|
||||
case Soc_NOTE_INS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_INS_SHA_PUB_FILE:
|
||||
/* Write location (institution) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Institution,Ins.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_CTR_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CTR_SHA_PUB_FILE:
|
||||
/* Write location (centre) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Centre,Ctr.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_DEG_DOC_PUB_FILE:
|
||||
case Soc_NOTE_DEG_SHA_PUB_FILE:
|
||||
/* Write location (degree) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Degree,Deg.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_CRS_DOC_PUB_FILE:
|
||||
case Soc_NOTE_CRS_SHA_PUB_FILE:
|
||||
case Soc_NOTE_EXAM_ANNOUNCEMENT:
|
||||
case Soc_NOTE_NOTICE:
|
||||
/* Write location (course) in hierarchy */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Course,Crs.ShortName);
|
||||
break;
|
||||
case Soc_NOTE_FORUM_POST:
|
||||
/* Write forum name */
|
||||
fprintf (Gbl.F.Out,"<div class=\"DAT\">%s: %s</div>",
|
||||
Txt_Forum,ForumName);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Write note summary */
|
||||
Soc_GetNoteSummary (SocNot,SummaryStr,Soc_MAX_BYTES_SUMMARY);
|
||||
|
@ -609,6 +611,7 @@ static void Soc_GetAndWriteSocialPost (long PstCod)
|
|||
/*****************************************************************************/
|
||||
/********* Put form to go to an action depending on the social note **********/
|
||||
/*****************************************************************************/
|
||||
// SocNot->Unavailable can be set to true inside this function
|
||||
|
||||
static void Soc_PutFormGoToAction (struct SocialNote *SocNot,long CrsCod)
|
||||
{
|
||||
|
@ -626,9 +629,11 @@ static void Soc_PutFormGoToAction (struct SocialNote *SocNot,long CrsCod)
|
|||
Gbl.InsideForm) // Inside another form
|
||||
{
|
||||
/***** Do not put form *****/
|
||||
fprintf (Gbl.F.Out,"%s",Txt_SOCIAL_NOTE[SocNot->NoteType]);
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_LIGHT\">%s",
|
||||
Txt_SOCIAL_NOTE[SocNot->NoteType]);
|
||||
if (SocNot->Unavailable)
|
||||
fprintf (Gbl.F.Out," (%s)",Txt_not_available);
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
}
|
||||
else // Not inside another form
|
||||
{
|
||||
|
@ -676,7 +681,7 @@ static void Soc_PutFormGoToAction (struct SocialNote *SocNot,long CrsCod)
|
|||
}
|
||||
|
||||
if (SocNot->Unavailable)
|
||||
fprintf (Gbl.F.Out,"%s (%s)",
|
||||
fprintf (Gbl.F.Out,"<span class=\"DAT_LIGHT\">%s (%s)</span>",
|
||||
Txt_SOCIAL_NOTE[SocNot->NoteType],Txt_not_available);
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user