Version 21.57: Nov 11, 2021 Code refactoring in timeline.

This commit is contained in:
acanas 2021-11-12 01:12:15 +01:00
parent 17e63e751c
commit cecb3aa2aa
44 changed files with 522 additions and 500 deletions

View File

@ -3462,7 +3462,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
margin:0; margin:0;
padding:0; padding:0;
} }
.TL_LIST .Tml_LIST
{ {
list-style-type:none; list-style-type:none;
padding:0; padding:0;
@ -3473,32 +3473,32 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
@media only screen and (max-width: 590px) @media only screen and (max-width: 590px)
{ /* For mobile-phones (maximum width visible on Moto G4 vertical) */ { /* For mobile-phones (maximum width visible on Moto G4 vertical) */
.TL_WIDTH {width:316px;} /* 556-240 */ .Tml_WIDTH {width:316px;} /* 556-240 */
.TL_RIGHT_WIDTH {width:260px;} /* 500-240 */ .Tml_RIGHT_WIDTH {width:260px;} /* 500-240 */
.TL_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */ .Tml_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */
.TL_COMM_WIDTH {width:220px;} /* 460-240 */ .Tml_COMM_WIDTH {width:220px;} /* 460-240 */
.TL_COMM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */ .Tml_COMM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */
.TL_MED_INPUT_WIDTH {width:160px;} /* 400-240 */ .Tml_MED_INPUT_WIDTH {width:160px;} /* 400-240 */
.TL_NOTE_FOOT_WIDTH {width:260px;} /* 500-240 */ .Tml_NOTE_FOOT_WIDTH {width:260px;} /* 500-240 */
.TL_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */ .Tml_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */
.TL_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */ .Tml_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */
.TL_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */ .Tml_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */
.TL_FAV_COM_WIDTH {width:200px;} /* 440-240 */ .Tml_FAV_COM_WIDTH {width:200px;} /* 440-240 */
} }
@media only screen and (min-width: 590px) @media only screen and (min-width: 590px)
{ /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */ { /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */
.TL_WIDTH {width:556px;} .Tml_WIDTH {width:556px;}
.TL_RIGHT_WIDTH {width:500px;} .Tml_RIGHT_WIDTH {width:500px;}
.TL_RIGHT_AUTHOR_WIDTH {width:340px;} .Tml_RIGHT_AUTHOR_WIDTH {width:340px;}
.TL_COMM_WIDTH {width:460px;} .Tml_COMM_WIDTH {width:460px;}
.TL_COMM_AUTHOR_WIDTH {width:300px;} .Tml_COMM_AUTHOR_WIDTH {width:300px;}
.TL_MED_INPUT_WIDTH {width:400px;} .Tml_MED_INPUT_WIDTH {width:400px;}
.TL_FAV_NOT_WIDTH {width:240px;} .Tml_FAV_NOT_WIDTH {width:240px;}
.TL_SHA_NOT_WIDTH {width:240px;} .Tml_SHA_NOT_WIDTH {width:240px;}
.TL_FAV_COM_WIDTH {width:440px;} .Tml_FAV_COM_WIDTH {width:440px;}
} }
.TL_NEW_PUB .Tml_NEW_PUB
{ {
background-color:#ddecf1; background-color:#ddecf1;
animation:fadein 2s linear forwards; animation:fadein 2s linear forwards;
@ -3507,12 +3507,12 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
{ {
to {background-color:white;} to {background-color:white;}
} }
.TL_FORM_NEW_PST .Tml_FORM_NEW_PST
{ {
padding:10px 0; padding:10px 0;
text-align:center; text-align:center;
} }
.TL_SEP /* Separator (upper line between publications) */ .Tml_SEP /* Separator (upper line between publications) */
{ {
border-top:1px solid silver; border-top:1px solid silver;
} }
@ -3530,7 +3530,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
color:#808080; color:#808080;
font-size:13pt; font-size:13pt;
} }
.TL_LEFT_PHOTO .Tml_LEFT_PHOTO
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3540,13 +3540,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
text-align:left; text-align:left;
vertical-align:top; vertical-align:top;
} }
.TL_RIGHT_CONT .Tml_RIGHT_CONT
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
padding-top:10px; padding-top:10px;
} }
.TL_RIGHT_AUTHOR .Tml_RIGHT_AUTHOR
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3556,7 +3556,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
} }
.TL_RIGHT_TIME .Tml_RIGHT_TIME
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3564,29 +3564,29 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
text-align:right; text-align:right;
vertical-align:top; vertical-align:top;
} }
.TL_PST_TEXTAREA .Tml_PST_TEXTAREA
{ {
box-sizing:border-box; box-sizing:border-box;
margin:0; margin:0;
resize:none; resize:none;
} }
.TL_PST_MED_CONT .Tml_PST_MED_CONT
{ {
box-sizing:border-box; box-sizing:border-box;
margin-top:10px; margin-top:10px;
} }
.TL_PST_MED .Tml_PST_MED
{ {
box-sizing:border-box; box-sizing:border-box;
border-radius:2px; border-radius:2px;
} }
.TL_COM_CONT .Tml_COM_CONT
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
padding-top:10px; padding-top:10px;
} }
.TL_COM_AUTHOR .Tml_COM_AUTHOR
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3596,17 +3596,17 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
} }
.TL_COM_MED_CONT .Tml_COM_MED_CONT
{ {
box-sizing:border-box; box-sizing:border-box;
margin-top:10px; margin-top:10px;
} }
.TL_COM_MED .Tml_COM_MED
{ {
box-sizing:border-box; box-sizing:border-box;
border-radius:2px; border-radius:2px;
} }
.TL_FORM_NEW_COM .Tml_FORM_NEW_COM
{ {
display:inline-block; display:inline-block;
margin-left:56px; margin-left:56px;
@ -3614,13 +3614,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
padding-bottom:10px; padding-bottom:10px;
text-align:center; text-align:center;
} }
.TL_COM_TEXTAREA .Tml_COM_TEXTAREA
{ {
box-sizing:border-box; box-sizing:border-box;
margin:0; margin:0;
resize:none; resize:none;
} }
.TL_BOTTOM_LEFT /* Container for button used to toggle new comment form */ .Tml_BOTTOM_LEFT /* Container for button used to toggle new comment form */
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3629,20 +3629,20 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
text-align:center; text-align:center;
vertical-align:bottom; vertical-align:bottom;
} }
.TL_BOTTOM_RIGHT /* Container for fav, share, remove and comments */ .Tml_BOTTOM_RIGHT /* Container for fav, share, remove and comments */
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
vertical-align:top; vertical-align:top;
} }
.TL_FORM .Tml_FORM
{ {
padding-top:8px; padding-top:8px;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
} }
.TL_FORM_OFF, .Tml_FORM_OFF,
.TL_LOC .Tml_LOC
{ {
padding-top:8px; padding-top:8px;
color:#808080; color:#808080;
@ -3650,7 +3650,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
} }
.TL_TXT .Tml_TXT
{ {
text-align:left; text-align:left;
padding-top:5px; padding-top:5px;
@ -3660,12 +3660,12 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
} }
.TL_EXPAND_COM .Tml_EXPAND_COM
{ {
text-align:center; text-align:center;
padding:10px 0; padding:10px 0;
} }
.TL_ICO_COM_OFF .Tml_ICO_COM_OFF
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3675,7 +3675,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
border:solid 1px; border:solid 1px;
border-color:transparent; border-color:transparent;
} }
.TL_ICO_COM_ON .Tml_ICO_COM_ON
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;
@ -3686,32 +3686,32 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
border-color:#C0DAE4; border-color:#C0DAE4;
background-color:#DDECF1; background-color:#DDECF1;
} }
.TL_FOOT /* Container for favs, shares and remove */ .Tml_FOOT /* Container for favs, shares and remove */
{ {
display:table; display:table;
vertical-align:top; vertical-align:top;
padding:7px 0; padding:7px 0;
} }
.TL_FAV_NOT, .TL_SHA_NOT .Tml_FAV_NOT, .Tml_SHA_NOT
{ {
display:table-cell; display:table-cell;
text-align:left; text-align:left;
vertical-align:top; vertical-align:top;
} }
.TL_FAV_COM .Tml_FAV_COM
{ {
display:table-cell; display:table-cell;
text-align:left; text-align:left;
vertical-align:top; vertical-align:top;
} }
.TL_REM .Tml_REM
{ {
display:table-cell; display:table-cell;
width:20px; width:20px;
text-align:right; text-align:right;
vertical-align:bottom; vertical-align:bottom;
} }
.TL_ICO .Tml_ICO
{ {
display:table-cell; display:table-cell;
} }
@ -3722,25 +3722,25 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
font-size:12pt; font-size:12pt;
font-weight:bold; font-weight:bold;
} }
.TL_USRS .Tml_USRS
{ {
display:table-cell; display:table-cell;
} }
.TL_ICO_DISABLED .Tml_ICO_DISABLED
{ {
opacity:0.1; opacity:0.1;
} }
.TL_SHARER .Tml_SHARER
{ {
display:inline-block; display:inline-block;
padding-left:4px; padding-left:4px;
vertical-align:bottom; vertical-align:bottom;
} }
.TL_COM .Tml_COM
{ {
border-top:1px solid silver; border-top:1px solid silver;
} }
.TL_COM_PHOTO .Tml_COM_PHOTO
{ {
display:inline-block; display:inline-block;
box-sizing:border-box; box-sizing:border-box;

View File

@ -987,7 +987,7 @@ function moveNewTimelineToTimeline () {
if (mostRecentOcurrenceOfNote) { if (mostRecentOcurrenceOfNote) {
// Move node from new timeline to timeline // Move node from new timeline to timeline
timeline.insertBefore(newTimeline.lastChild, timeline.firstChild); timeline.insertBefore(newTimeline.lastChild, timeline.firstChild);
timeline.firstChild.className += " TL_NEW_PUB"; timeline.firstChild.className += " Tml_NEW_PUB";
} }
else else
// Remove last child (because is repeated in more recent pubs) // Remove last child (because is repeated in more recent pubs)
@ -1397,10 +1397,10 @@ function toggleOffGIF (elem, staticURL) {
function toggleNewComment (id) { function toggleNewComment (id) {
var iconDiv = document.getElementById (id + '_ico'); var iconDiv = document.getElementById (id + '_ico');
if (iconDiv.className == 'TL_ICO_COM_OFF') if (iconDiv.className == 'Tml_ICO_COM_OFF')
iconDiv.className = 'TL_ICO_COM_ON'; iconDiv.className = 'Tml_ICO_COM_ON';
else else
iconDiv.className = 'TL_ICO_COM_OFF'; iconDiv.className = 'Tml_ICO_COM_OFF';
toggleDisplay(id); toggleDisplay(id);
} }

View File

@ -3835,7 +3835,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
return false; return false;
} }
return (bool) (Permission & (1 << Gbl.Usrs.Me.Role.Logged)); return ((Permission & (1 << Gbl.Usrs.Me.Role.Logged)) != 0);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -274,8 +274,8 @@ static void Asg_PutHeadForSeeing (struct Asg_Assignments *Assignments,
static bool Asg_CheckIfICanCreateAssignments (void) static bool Asg_CheckIfICanCreateAssignments (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || return Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -6062,7 +6062,7 @@ static bool Brw_GetMyClipboard (void)
if (NumRows > 1) if (NumRows > 1)
Err_WrongCopySrcExit (); Err_WrongCopySrcExit ();
return (bool) (NumRows == 1); return NumRows == 1;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -8669,28 +8669,28 @@ void Brw_ChgFileMetadata (void)
switch (Gbl.FileBrowser.Type) switch (Gbl.FileBrowser.Type)
{ {
case Brw_ADMI_DOC_INS: case Brw_ADMI_DOC_INS:
Tml_Not_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_SHR_INS: case Brw_ADMI_SHR_INS:
Tml_Not_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_DOC_CTR: case Brw_ADMI_DOC_CTR:
Tml_Not_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_SHR_CTR: case Brw_ADMI_SHR_CTR:
Tml_Not_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_DOC_DEG: case Brw_ADMI_DOC_DEG:
Tml_Not_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_SHR_DEG: case Brw_ADMI_SHR_DEG:
Tml_Not_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_DOC_CRS: case Brw_ADMI_DOC_CRS:
Tml_Not_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod);
break; break;
case Brw_ADMI_SHR_CRS: case Brw_ADMI_SHR_CRS:
Tml_Not_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod);
break; break;
default: default:
break; break;

View File

@ -201,7 +201,7 @@ static Bld_Order_t Bld_GetParamBuildingOrder (void)
static bool Bld_CheckIfICanCreateBuildings (void) static bool Bld_CheckIfICanCreateBuildings (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM); return Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -358,7 +358,7 @@ void Cfe_ReceiveCallForExam2 (void)
Cfe_DB_UpdateNumUsrsNotifiedByEMailAboutCallForExam (CallsForExams->HighlightExaCod,NumUsrsToBeNotifiedByEMail); Cfe_DB_UpdateNumUsrsNotifiedByEMailAboutCallForExam (CallsForExams->HighlightExaCod,NumUsrsToBeNotifiedByEMail);
/***** Create a new social note about the new call for exam *****/ /***** Create a new social note about the new call for exam *****/
Tml_Not_StoreAndPublishNote (TL_NOTE_CALL_FOR_EXAM,CallsForExams->HighlightExaCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_CALL_FOR_EXAM,CallsForExams->HighlightExaCod);
/***** Update RSS of current course *****/ /***** Update RSS of current course *****/
RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs);
@ -457,7 +457,7 @@ void Cfe_RemoveCallForExam1 (void)
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_CALL_FOR_EXAM,ExaCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_CALL_FOR_EXAM,ExaCod);
/***** Mark possible social note as unavailable *****/ /***** Mark possible social note as unavailable *****/
Tml_DB_MarkNoteAsUnavailable (TL_NOTE_CALL_FOR_EXAM,ExaCod); Tml_DB_MarkNoteAsUnavailable (Tml_NOTE_CALL_FOR_EXAM,ExaCod);
/***** Update RSS of current course *****/ /***** Update RSS of current course *****/
RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs);

View File

@ -289,7 +289,7 @@ static void Ctr_ListCenters (void)
static bool Ctr_CheckIfICanCreateCenters (void) static bool Ctr_CheckIfICanCreateCenters (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); return Gbl.Usrs.Me.Role.Logged >= Rol_GST;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -925,9 +925,9 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
static bool Ctr_CheckIfICanEditACenter (struct Ctr_Center *Ctr) static bool Ctr_CheckIfICanEditACenter (struct Ctr_Center *Ctr)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM || // I am an institution administrator or higher return Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM || // I am an institution administrator or higher
((Ctr->Status & Hie_STATUS_BIT_PENDING) != 0 && // Center is not yet activated ((Ctr->Status & Hie_STATUS_BIT_PENDING) != 0 && // Center is not yet activated
Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod)); // I am the requester Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod); // I am the requester
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1912,8 +1912,8 @@ static void Ctr_FormToGoToMap (struct Ctr_Center *Ctr)
bool Ctr_GetIfMapIsAvailable (const struct Ctr_Center *Ctr) bool Ctr_GetIfMapIsAvailable (const struct Ctr_Center *Ctr)
{ {
/***** Coordinates 0, 0 means not set ==> don't show map *****/ /***** Coordinates 0, 0 means not set ==> don't show map *****/
return (bool) (Ctr->Coord.Latitude || return Ctr->Coord.Latitude ||
Ctr->Coord.Longitude); Ctr->Coord.Longitude;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/ */
#define Log_PLATFORM_VERSION "SWAD 21.56.5 (2021-11-10)" #define Log_PLATFORM_VERSION "SWAD 21.57 (2021-11-11)"
#define CSS_FILE "swad20.45.css" #define CSS_FILE "swad21.57.css"
#define JS_FILE "swad20.69.1.js" #define JS_FILE "swad21.57.js"
/* /*
TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 21.57: Nov 11, 2021 Code refactoring in timeline. (319208 lines)
Version 21.56.5: Nov 10, 2021 Code refactoring in switch statements. (319181 lines) Version 21.56.5: Nov 10, 2021 Code refactoring in switch statements. (319181 lines)
Version 21.56.4: Nov 10, 2021 Code refactoring in switch statements (until swad_network_database.c). (319362 lines) Version 21.56.4: Nov 10, 2021 Code refactoring in switch statements (until swad_network_database.c). (319362 lines)
Version 21.56.3: Nov 10, 2021 Code refactoring in switch statements (until swad_logo.c). (319403 lines) Version 21.56.3: Nov 10, 2021 Code refactoring in switch statements (until swad_logo.c). (319403 lines)

View File

@ -473,7 +473,7 @@ static void Cty_PutIconsListingCountries (__attribute__((unused)) void *Args)
bool Cty_CheckIfICanEditCountries (void) bool Cty_CheckIfICanEditCountries (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); return Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -894,7 +894,7 @@ static void Crs_ListCourses (void)
static bool Crs_CheckIfICanCreateCourses (void) static bool Crs_CheckIfICanCreateCourses (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); return Gbl.Usrs.Me.Role.Logged >= Rol_GST;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1292,9 +1292,9 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
static bool Crs_CheckIfICanEdit (struct Crs_Course *Crs) static bool Crs_CheckIfICanEdit (struct Crs_Course *Crs)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM || // I am a degree administrator or higher return Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM || // I am a degree administrator or higher
((Crs->Status & Hie_STATUS_BIT_PENDING) != 0 && // Course is not yet activated ((Crs->Status & Hie_STATUS_BIT_PENDING) != 0 && // Course is not yet activated
Gbl.Usrs.Me.UsrDat.UsrCod == Crs->RequesterUsrCod)); // I am the requester Gbl.Usrs.Me.UsrDat.UsrCod == Crs->RequesterUsrCod); // I am the requester
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -478,9 +478,9 @@ static void Deg_ListDegreesForEdition (void)
static bool Deg_CheckIfICanEditADegree (struct Deg_Degree *Deg) static bool Deg_CheckIfICanEditADegree (struct Deg_Degree *Deg)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM || // I am a center administrator or higher return Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM || // I am a center administrator or higher
((Deg->Status & Hie_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated ((Deg->Status & Hie_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated
Gbl.Usrs.Me.UsrDat.UsrCod == Deg->RequesterUsrCod)); // I am the requester Gbl.Usrs.Me.UsrDat.UsrCod == Deg->RequesterUsrCod); // I am the requester
} }
/*****************************************************************************/ /*****************************************************************************/
@ -729,7 +729,7 @@ static void Deg_ListDegrees (void)
static bool Deg_CheckIfICanCreateDegrees (void) static bool Deg_CheckIfICanCreateDegrees (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); return Gbl.Usrs.Me.Role.Logged >= Rol_GST;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -1561,7 +1561,7 @@ bool Exa_CheckIfEditable (const struct Exa_Exam *Exam)
{ {
if (Exa_CheckIfICanEditExams ()) if (Exa_CheckIfICanEditExams ())
/***** Questions are editable only if exam has no sessions *****/ /***** Questions are editable only if exam has no sessions *****/
return (bool) (Exam->NumSess == 0); // Exams with sessions should not be edited return Exam->NumSess == 0; // Exams with sessions should not be edited
else else
return false; // Questions are not editable return false; // Questions are not editable
} }

View File

@ -2230,7 +2230,7 @@ static void Fig_GetAndShowTimelineActivityStats (void)
extern const char *Txt_Number_of_users; extern const char *Txt_Number_of_users;
extern const char *Txt_PERCENT_of_users; extern const char *Txt_PERCENT_of_users;
extern const char *Txt_Number_of_posts_BR_per_user; extern const char *Txt_Number_of_posts_BR_per_user;
extern const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES]; extern const char *Txt_TIMELINE_NOTE[Tml_NOT_NUM_NOTE_TYPES];
extern const char *Txt_Total; extern const char *Txt_Total;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -2258,7 +2258,7 @@ static void Fig_GetAndShowTimelineActivityStats (void)
/***** Get total number of timeline notes and users for each note type *****/ /***** Get total number of timeline notes and users for each note type *****/
for (NoteType = (Tml_Not_Type_t) 0; for (NoteType = (Tml_Not_Type_t) 0;
NoteType <= (Tml_Not_Type_t) (TL_NOT_NUM_NOTE_TYPES - 1); NoteType <= (Tml_Not_Type_t) (Tml_NOT_NUM_NOTE_TYPES - 1);
NoteType++) NoteType++)
{ {
/***** Get number of timeline notes and users for this type *****/ /***** Get number of timeline notes and users for this type *****/

View File

@ -2836,7 +2836,7 @@ void For_ReceiveForumPost (void)
{ {
case For_FORUM_GLOBAL_USRS: case For_FORUM_GLOBAL_USRS:
case For_FORUM__SWAD__USRS: case For_FORUM__SWAD__USRS:
Tml_Not_StoreAndPublishNote (TL_NOTE_FORUM_POST,PstCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_FORUM_POST,PstCod);
break; break;
default: default:
break; break;
@ -2911,7 +2911,7 @@ void For_RemovePost (void)
{ {
case For_FORUM_GLOBAL_USRS: case For_FORUM_GLOBAL_USRS:
case For_FORUM__SWAD__USRS: case For_FORUM__SWAD__USRS:
Tml_DB_MarkNoteAsUnavailable (TL_NOTE_FORUM_POST,Forums.PstCod); Tml_DB_MarkNoteAsUnavailable (Tml_NOTE_FORUM_POST,Forums.PstCod);
break; break;
default: default:
break; break;

View File

@ -2196,9 +2196,9 @@ static bool Gam_CheckIfEditable (const struct Gam_Game *Game)
{ {
if (Gam_CheckIfICanEditGames ()) if (Gam_CheckIfICanEditGames ())
/***** Questions are editable only if game has no matches *****/ /***** Questions are editable only if game has no matches *****/
return (bool) (Game->NumMchs == 0); // Games with matches should not be edited return Game->NumMchs == 0; // Games with matches should not be edited
else else
return false; // Questions are not editable return false; // Questions are not editable
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -385,7 +385,7 @@ void Ico_PutContextualIconToZIP (Act_Action_t NextAction,
void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title) void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title)
{ {
HTM_DIV_Begin ("class=\"%s\"",DivClass); HTM_DIV_Begin ("class=\"%s\"",DivClass);
Ico_PutIcon (Icon,Title,"CONTEXT_ICO_16x16"); Ico_PutIcon (Icon,Title,"CONTEXT_ICO_16x16");
HTM_DIV_End (); HTM_DIV_End ();
} }
@ -396,7 +396,7 @@ void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title)
void Ico_PutDivIconLink (const char *DivClass,const char *Icon,const char *Title) void Ico_PutDivIconLink (const char *DivClass,const char *Icon,const char *Title)
{ {
HTM_DIV_Begin ("class=\"%s\"",DivClass); HTM_DIV_Begin ("class=\"%s\"",DivClass);
Ico_PutIconLink (Icon,Title); Ico_PutIconLink (Icon,Title);
HTM_DIV_End (); HTM_DIV_End ();
} }
@ -417,8 +417,8 @@ void Ico_PutIconTextLink (const char *Icon,const char *Text)
{ {
/***** Print icon and optional text *****/ /***** Print icon and optional text *****/
HTM_DIV_Begin ("class=\"CONTEXT_OPT ICO_HIGHLIGHT\""); HTM_DIV_Begin ("class=\"CONTEXT_OPT ICO_HIGHLIGHT\"");
Ico_PutIcon (Icon,Text,"CONTEXT_ICO_x16"); Ico_PutIcon (Icon,Text,"CONTEXT_ICO_x16");
HTM_TxtF ("&nbsp;%s",Text); HTM_TxtF ("&nbsp;%s",Text);
HTM_DIV_End (); HTM_DIV_End ();
} }

View File

@ -326,7 +326,7 @@ static void Ins_ListInstitutions (void)
static bool Ins_CheckIfICanCreateInstitutions (void) static bool Ins_CheckIfICanCreateInstitutions (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); return Gbl.Usrs.Me.Role.Logged >= Rol_GST;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1069,9 +1069,9 @@ static void Ins_ListInstitutionsForEdition (void)
static bool Ins_CheckIfICanEdit (struct Ins_Instit *Ins) static bool Ins_CheckIfICanEdit (struct Ins_Instit *Ins)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM || // I am a superuser return Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM || // I am a superuser
((Ins->Status & Hie_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated ((Ins->Status & Hie_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated
Gbl.Usrs.Me.UsrDat.UsrCod == Ins->RequesterUsrCod)); // I am the requester Gbl.Usrs.Me.UsrDat.UsrCod == Ins->RequesterUsrCod); // I am the requester
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -160,7 +160,7 @@ void Not_ReceiveNotice (void)
Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail); Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail);
/***** Create a new social note about the new notice *****/ /***** Create a new social note about the new notice *****/
Tml_Not_StoreAndPublishNote (TL_NOTE_NOTICE,NotCod); Tml_Not_StoreAndPublishNote (Tml_NOTE_NOTICE,NotCod);
/***** Set notice to be highlighted *****/ /***** Set notice to be highlighted *****/
Gbl.Crs.Notices.HighlightNotCod = NotCod; Gbl.Crs.Notices.HighlightNotCod = NotCod;
@ -296,7 +296,7 @@ void Not_RemoveNotice (void)
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod);
/***** Mark possible social note as unavailable *****/ /***** Mark possible social note as unavailable *****/
Tml_DB_MarkNoteAsUnavailable (TL_NOTE_NOTICE,NotCod); Tml_DB_MarkNoteAsUnavailable (Tml_NOTE_NOTICE,NotCod);
/***** Update RSS of current course *****/ /***** Update RSS of current course *****/
RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs);
@ -440,8 +440,8 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod)
static bool Not_CheckIfICanEditNotices (void) static bool Not_CheckIfICanEditNotices (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || return Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -85,10 +85,10 @@ const char *Ntf_WSNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "unknown", [Ntf_EVENT_UNKNOWN ] = "unknown",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TL_COMMENT ] = "timelineComment", [Ntf_EVENT_TML_COMMENT ] = "timelineComment",
[Ntf_EVENT_TL_FAV ] = "timelineFav", [Ntf_EVENT_TML_FAV ] = "timelineFav",
[Ntf_EVENT_TL_SHARE ] = "timelineShare", [Ntf_EVENT_TML_SHARE ] = "timelineShare",
[Ntf_EVENT_TL_MENTION ] = "timelineMention", [Ntf_EVENT_TML_MENTION ] = "timelineMention",
[Ntf_EVENT_FOLLOWER ] = "follower", [Ntf_EVENT_FOLLOWER ] = "follower",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -123,10 +123,10 @@ static const Act_Action_t Ntf_DefaultActions[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = ActUnk, [Ntf_EVENT_UNKNOWN ] = ActUnk,
/* Start tab */ /* Start tab */
[Ntf_EVENT_TL_COMMENT ] = ActSeeGblTL, [Ntf_EVENT_TML_COMMENT ] = ActSeeGblTL,
[Ntf_EVENT_TL_FAV ] = ActSeeGblTL, [Ntf_EVENT_TML_FAV ] = ActSeeGblTL,
[Ntf_EVENT_TL_SHARE ] = ActSeeGblTL, [Ntf_EVENT_TML_SHARE ] = ActSeeGblTL,
[Ntf_EVENT_TL_MENTION ] = ActSeeGblTL, [Ntf_EVENT_TML_MENTION ] = ActSeeGblTL,
[Ntf_EVENT_FOLLOWER ] = ActSeeFlr, [Ntf_EVENT_FOLLOWER ] = ActSeeFlr,
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -166,10 +166,10 @@ static const char *Ntf_ParamNotifMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "NotifyNtfEventUnknown", [Ntf_EVENT_UNKNOWN ] = "NotifyNtfEventUnknown",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TL_COMMENT ] = "NotifyNtfEventTimelineComment", [Ntf_EVENT_TML_COMMENT ] = "NotifyNtfEventTimelineComment",
[Ntf_EVENT_TL_FAV ] = "NotifyNtfEventTimelineFav", [Ntf_EVENT_TML_FAV ] = "NotifyNtfEventTimelineFav",
[Ntf_EVENT_TL_SHARE ] = "NotifyNtfEventTimelineShare", [Ntf_EVENT_TML_SHARE ] = "NotifyNtfEventTimelineShare",
[Ntf_EVENT_TL_MENTION ] = "NotifyNtfEventTimelineMention", [Ntf_EVENT_TML_MENTION ] = "NotifyNtfEventTimelineMention",
[Ntf_EVENT_FOLLOWER ] = "NotifyNtfEventFollower", [Ntf_EVENT_FOLLOWER ] = "NotifyNtfEventFollower",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -205,10 +205,10 @@ static const char *Ntf_ParamEmailMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "EmailNtfEventUnknown", [Ntf_EVENT_UNKNOWN ] = "EmailNtfEventUnknown",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TL_COMMENT ] = "EmailNtfEventTimelineComment", [Ntf_EVENT_TML_COMMENT ] = "EmailNtfEventTimelineComment",
[Ntf_EVENT_TL_FAV ] = "EmailNtfEventTimelineFav", [Ntf_EVENT_TML_FAV ] = "EmailNtfEventTimelineFav",
[Ntf_EVENT_TL_SHARE ] = "EmailNtfEventTimelineShare", [Ntf_EVENT_TML_SHARE ] = "EmailNtfEventTimelineShare",
[Ntf_EVENT_TL_MENTION ] = "EmailNtfEventTimelineMention", [Ntf_EVENT_TML_MENTION ] = "EmailNtfEventTimelineMention",
[Ntf_EVENT_FOLLOWER ] = "EmailNtfEventSocialFollower", [Ntf_EVENT_FOLLOWER ] = "EmailNtfEventSocialFollower",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -244,10 +244,10 @@ static const char *Ntf_Icons[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "question.svg", [Ntf_EVENT_UNKNOWN ] = "question.svg",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TL_COMMENT ] = "comment-dots.svg", [Ntf_EVENT_TML_COMMENT ] = "comment-dots.svg",
[Ntf_EVENT_TL_FAV ] = "star.svg", [Ntf_EVENT_TML_FAV ] = "star.svg",
[Ntf_EVENT_TL_SHARE ] = "share-alt.svg", [Ntf_EVENT_TML_SHARE ] = "share-alt.svg",
[Ntf_EVENT_TL_MENTION ] = "at.svg", [Ntf_EVENT_TML_MENTION ] = "at.svg",
[Ntf_EVENT_FOLLOWER ] = "user-plus.svg", [Ntf_EVENT_FOLLOWER ] = "user-plus.svg",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -720,10 +720,10 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent,
Brw_PutHiddenParamFilCod (FileMetadata.FilCod); Brw_PutHiddenParamFilCod (FileMetadata.FilCod);
} }
break; break;
case Ntf_EVENT_TL_COMMENT: case Ntf_EVENT_TML_COMMENT:
case Ntf_EVENT_TL_FAV: case Ntf_EVENT_TML_FAV:
case Ntf_EVENT_TL_SHARE: case Ntf_EVENT_TML_SHARE:
case Ntf_EVENT_TL_MENTION: case Ntf_EVENT_TML_MENTION:
// Cod is the code of the social publishing // Cod is the code of the social publishing
Frm_BeginForm (ActSeeGblTL); Frm_BeginForm (ActSeeGblTL);
Tml_Pub_PutHiddenParamPubCod (Cod); Tml_Pub_PutHiddenParamPubCod (Cod);
@ -873,10 +873,10 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
case Ntf_EVENT_ENROLMENT_REQUEST: case Ntf_EVENT_ENROLMENT_REQUEST:
Enr_GetNotifEnrolmentRequest (SummaryStr,ContentStr,Cod,GetContent); Enr_GetNotifEnrolmentRequest (SummaryStr,ContentStr,Cod,GetContent);
break; break;
case Ntf_EVENT_TL_COMMENT: case Ntf_EVENT_TML_COMMENT:
case Ntf_EVENT_TL_FAV: case Ntf_EVENT_TML_FAV:
case Ntf_EVENT_TL_SHARE: case Ntf_EVENT_TML_SHARE:
case Ntf_EVENT_TL_MENTION: case Ntf_EVENT_TML_MENTION:
// Cod is the code of the social publishing // Cod is the code of the social publishing
Tml_Ntf_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent); Tml_Ntf_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent);
break; break;
@ -1040,13 +1040,13 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
// ==> send notification to administrators or superusers // ==> send notification to administrators or superusers
NumUsrs = Adm_DB_GetAdmsCurrentScopeExceptMe (&mysql_res); NumUsrs = Adm_DB_GetAdmsCurrentScopeExceptMe (&mysql_res);
break; break;
case Ntf_EVENT_TL_COMMENT: // New comment to one of my social notes or comments case Ntf_EVENT_TML_COMMENT: // New comment to one of my social notes or comments
// Cod is the code of the social publishing // Cod is the code of the social publishing
NumUsrs = Tml_DB_GetPublishersInNoteExceptMe (&mysql_res,Cod); NumUsrs = Tml_DB_GetPublishersInNoteExceptMe (&mysql_res,Cod);
break; break;
case Ntf_EVENT_TL_FAV: // New favourite to one of my social notes or comments case Ntf_EVENT_TML_FAV: // New favourite to one of my social notes or comments
case Ntf_EVENT_TL_SHARE: // New sharing of one of my social notes case Ntf_EVENT_TML_SHARE: // New sharing of one of my social notes
case Ntf_EVENT_TL_MENTION: case Ntf_EVENT_TML_MENTION:
case Ntf_EVENT_FOLLOWER: case Ntf_EVENT_FOLLOWER:
// This function should not be called in these cases // This function should not be called in these cases
return 0; return 0;
@ -1312,10 +1312,10 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
switch (NotifyEvent) switch (NotifyEvent)
{ {
case Ntf_EVENT_UNKNOWN: case Ntf_EVENT_UNKNOWN:
case Ntf_EVENT_TL_COMMENT: case Ntf_EVENT_TML_COMMENT:
case Ntf_EVENT_TL_FAV: case Ntf_EVENT_TML_FAV:
case Ntf_EVENT_TL_SHARE: case Ntf_EVENT_TML_SHARE:
case Ntf_EVENT_TL_MENTION: case Ntf_EVENT_TML_MENTION:
case Ntf_EVENT_FOLLOWER: case Ntf_EVENT_FOLLOWER:
break; break;
case Ntf_EVENT_DOCUMENT_FILE: case Ntf_EVENT_DOCUMENT_FILE:

View File

@ -55,10 +55,10 @@ typedef enum // TODO: Change numbers (also in database)!!!!!!!!!!!!!!
{ {
Ntf_EVENT_UNKNOWN = 0, Ntf_EVENT_UNKNOWN = 0,
/* Start tab */ /* Start tab */
Ntf_EVENT_TL_COMMENT = 10, // New comment to one of my social publishings (notes or comments) Ntf_EVENT_TML_COMMENT = 10, // New comment to one of my social publishings (notes or comments)
Ntf_EVENT_TL_FAV = 11, // New fav of one of my social publishings (notes or comments) Ntf_EVENT_TML_FAV = 11, // New fav of one of my social publishings (notes or comments)
Ntf_EVENT_TL_SHARE = 12, // New sharing of one of my social notes Ntf_EVENT_TML_SHARE = 12, // New sharing of one of my social notes
Ntf_EVENT_TL_MENTION = 13, // New mention Ntf_EVENT_TML_MENTION = 13, // New mention
Ntf_EVENT_FOLLOWER = 14, Ntf_EVENT_FOLLOWER = 14,
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */

View File

@ -237,7 +237,7 @@ static Plc_Order_t Plc_GetParamPlcOrder (void)
static bool Plc_CheckIfICanCreatePlaces (void) static bool Plc_CheckIfICanCreatePlaces (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM); return Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -246,7 +246,7 @@ void Prf_GetUsrDatAndShowUserProfile (void)
Tml_ResetTimeline (&Timeline); Tml_ResetTimeline (&Timeline);
/* Show timeline */ /* Show timeline */
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
Tml_ShowTimelineUsr (&Timeline); Tml_ShowTimelineUsr (&Timeline);
HTM_SECTION_End (); HTM_SECTION_End ();
} }

View File

@ -317,8 +317,8 @@ static void Prg_ShowAllItems (Prg_CreateOrChangeItem_t CreateOrChangeItem,
static bool Prg_CheckIfICanCreateItems (void) static bool Prg_CheckIfICanCreateItems (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || return Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -429,8 +429,8 @@ void Qst_ShowFormRequestSelectQstsForGame (struct Gam_Games *Games,
bool Qst_CheckIfICanEditQsts (void) bool Qst_CheckIfICanEditQsts (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || return Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -371,7 +371,7 @@ static Roo_Order_t Roo_GetParamRoomOrder (void)
static bool Roo_CheckIfICanCreateRooms (void) static bool Roo_CheckIfICanCreateRooms (void)
{ {
return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM); return Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -745,11 +745,11 @@ void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *T
Usr_DONT_GET_ROLE_IN_CURRENT_CRS); Usr_DONT_GET_ROLE_IN_CURRENT_CRS);
/* Create notification for the mentioned user *****/ /* Create notification for the mentioned user *****/
CreateNotif = (UsrDat.NtfEvents.CreateNotif & (1 << Ntf_EVENT_TL_MENTION)); CreateNotif = (UsrDat.NtfEvents.CreateNotif & (1 << Ntf_EVENT_TML_MENTION));
if (CreateNotif) if (CreateNotif)
{ {
NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION)); NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TML_MENTION));
Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_TL_MENTION,UsrDat.UsrCod,PubCod, Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_TML_MENTION,UsrDat.UsrCod,PubCod,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,
@ -2641,7 +2641,7 @@ bool Str_Path1BeginsByPath2 (const char *Path1,const char *Path2)
/* The string Path1 starts by the complete string Path2 */ /* The string Path1 starts by the complete string Path2 */
/* Check that the next character of Path1 is '\0' or '/' */ /* Check that the next character of Path1 is '\0' or '/' */
return (bool) (*Path1 == '\0' || *Path1 == '/'); return *Path1 == '\0' || *Path1 == '/';
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -27899,7 +27899,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novos pedidos de inscri&ccedil;&atilde;o" "Novos pedidos de inscri&ccedil;&atilde;o"
#endif #endif
, ,
[Ntf_EVENT_TL_COMMENT] = [Ntf_EVENT_TML_COMMENT] =
#if L==1 // ca #if L==1 // ca
"Nous comentaris als meus missatges socials" "Nous comentaris als meus missatges socials"
#elif L==2 // de #elif L==2 // de
@ -27920,7 +27920,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novos coment&aacute;rio &agrave;s minhos posts sociais" "Novos coment&aacute;rio &agrave;s minhos posts sociais"
#endif #endif
, ,
[Ntf_EVENT_TL_FAV] = [Ntf_EVENT_TML_FAV] =
#if L==1 // ca #if L==1 // ca
"Nous favorits als meus missatges socials" "Nous favorits als meus missatges socials"
#elif L==2 // de #elif L==2 // de
@ -27941,7 +27941,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novos favoritos &agrave;s minhos posts sociais" "Novos favoritos &agrave;s minhos posts sociais"
#endif #endif
, ,
[Ntf_EVENT_TL_SHARE] = [Ntf_EVENT_TML_SHARE] =
#if L==1 // ca #if L==1 // ca
"Noves comparticions dels meus missatges socials" "Noves comparticions dels meus missatges socials"
#elif L==2 // de #elif L==2 // de
@ -27962,7 +27962,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novas partilhas de minhos posts sociais" "Novas partilhas de minhos posts sociais"
#endif #endif
, ,
[Ntf_EVENT_TL_MENTION] = [Ntf_EVENT_TML_MENTION] =
#if L==1 // ca #if L==1 // ca
"Noves mencions" "Noves mencions"
#elif L==2 // de #elif L==2 // de
@ -28343,7 +28343,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Pedido de inscri&ccedil;&atilde;o" "Pedido de inscri&ccedil;&atilde;o"
#endif #endif
, ,
[Ntf_EVENT_TL_COMMENT] = [Ntf_EVENT_TML_COMMENT] =
#if L==1 // ca #if L==1 // ca
"Comentari a un missatge social" "Comentari a un missatge social"
#elif L==2 // de #elif L==2 // de
@ -28364,7 +28364,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Coment&aacute;rio a um post sociais" "Coment&aacute;rio a um post sociais"
#endif #endif
, ,
[Ntf_EVENT_TL_FAV] = [Ntf_EVENT_TML_FAV] =
#if L==1 // ca #if L==1 // ca
"Missatge social marcat com favorit" "Missatge social marcat com favorit"
#elif L==2 // de #elif L==2 // de
@ -28385,7 +28385,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Post sociais marcado como favorito" "Post sociais marcado como favorito"
#endif #endif
, ,
[Ntf_EVENT_TL_SHARE] = [Ntf_EVENT_TML_SHARE] =
#if L==1 // ca #if L==1 // ca
"Missatge social compartit" "Missatge social compartit"
#elif L==2 // de #elif L==2 // de
@ -28406,7 +28406,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Post sociais compartido" "Post sociais compartido"
#endif #endif
, ,
[Ntf_EVENT_TL_MENTION] = [Ntf_EVENT_TML_MENTION] =
#if L==1 // ca #if L==1 // ca
"Menci&oacute;" "Menci&oacute;"
#elif L==2 // de #elif L==2 // de
@ -52601,9 +52601,9 @@ const char *Txt_TIMELINE_Not_shared_by_anyone = // No shared
"N&atilde;o compartilhado por qualquer pessoa"; "N&atilde;o compartilhado por qualquer pessoa";
#endif #endif
const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = const char *Txt_TIMELINE_NOTE[Tml_NOT_NUM_NOTE_TYPES] =
{ {
[TL_NOTE_UNKNOWN] = [Tml_NOTE_UNKNOWN] =
#if L==1 // ca #if L==1 // ca
"Esdeveniment desconegut" "Esdeveniment desconegut"
#elif L==2 // de #elif L==2 // de
@ -52624,7 +52624,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Evento desconhecido" "Evento desconhecido"
#endif #endif
, ,
[TL_NOTE_INS_DOC_PUB_FILE] = [Tml_NOTE_INS_DOC_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Document p&uacute;blic (instituci&oacute;)" "Document p&uacute;blic (instituci&oacute;)"
#elif L==2 // de #elif L==2 // de
@ -52645,7 +52645,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo de documento p&uacute;blico (institu&ccedil;&atilde;o)" "Arquivo de documento p&uacute;blico (institu&ccedil;&atilde;o)"
#endif #endif
, ,
[TL_NOTE_INS_SHA_PUB_FILE] = [Tml_NOTE_INS_SHA_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Arxiu compartit p&uacute;blic (instituci&oacute;)" "Arxiu compartit p&uacute;blic (instituci&oacute;)"
#elif L==2 // de #elif L==2 // de
@ -52666,7 +52666,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo compartilhado p&uacute;blico (institu&ccedil;&atilde;o)" "Arquivo compartilhado p&uacute;blico (institu&ccedil;&atilde;o)"
#endif #endif
, ,
[TL_NOTE_CTR_DOC_PUB_FILE] = [Tml_NOTE_CTR_DOC_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Document p&uacute;blic (center)" "Document p&uacute;blic (center)"
#elif L==2 // de #elif L==2 // de
@ -52687,7 +52687,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo de documento p&uacute;blico (centro)" "Arquivo de documento p&uacute;blico (centro)"
#endif #endif
, ,
[TL_NOTE_CTR_SHA_PUB_FILE] = [Tml_NOTE_CTR_SHA_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Arxiu compartit p&uacute;blic (center)" "Arxiu compartit p&uacute;blic (center)"
#elif L==2 // de #elif L==2 // de
@ -52708,7 +52708,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo compartilhado p&uacute;blico (centro)" "Arquivo compartilhado p&uacute;blico (centro)"
#endif #endif
, ,
[TL_NOTE_DEG_DOC_PUB_FILE] = [Tml_NOTE_DEG_DOC_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Document p&uacute;blic (titulaci&oacute;)" "Document p&uacute;blic (titulaci&oacute;)"
#elif L==2 // de #elif L==2 // de
@ -52729,7 +52729,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo de documento p&uacute;blico (grau)" "Arquivo de documento p&uacute;blico (grau)"
#endif #endif
, ,
[TL_NOTE_DEG_SHA_PUB_FILE] = [Tml_NOTE_DEG_SHA_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Arxiu compartit p&uacute;blic (titulaci&oacute;)" "Arxiu compartit p&uacute;blic (titulaci&oacute;)"
#elif L==2 // de #elif L==2 // de
@ -52750,7 +52750,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo compartilhado p&uacute;blico (grau)" "Arquivo compartilhado p&uacute;blico (grau)"
#endif #endif
, ,
[TL_NOTE_CRS_DOC_PUB_FILE] = [Tml_NOTE_CRS_DOC_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Document p&uacute;blic (assignatura)" "Document p&uacute;blic (assignatura)"
#elif L==2 // de #elif L==2 // de
@ -52771,7 +52771,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo de documento p&uacute;blico (disciplina)" "Arquivo de documento p&uacute;blico (disciplina)"
#endif #endif
, ,
[TL_NOTE_CRS_SHA_PUB_FILE] = [Tml_NOTE_CRS_SHA_PUB_FILE] =
#if L==1 // ca #if L==1 // ca
"Arxiu compartit p&uacute;blic (assignatura)" "Arxiu compartit p&uacute;blic (assignatura)"
#elif L==2 // de #elif L==2 // de
@ -52792,7 +52792,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Arquivo compartilhado p&uacute;blico (disciplina)" "Arquivo compartilhado p&uacute;blico (disciplina)"
#endif #endif
, ,
[TL_NOTE_CALL_FOR_EXAM] = [Tml_NOTE_CALL_FOR_EXAM] =
#if L==1 // ca #if L==1 // ca
"Convocat&ograve;ria d'examen" "Convocat&ograve;ria d'examen"
#elif L==2 // de #elif L==2 // de
@ -52813,7 +52813,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Chamada para exame" "Chamada para exame"
#endif #endif
, ,
[TL_NOTE_POST] = [Tml_NOTE_POST] =
#if L==1 // ca #if L==1 // ca
"Missatge social" "Missatge social"
#elif L==2 // de #elif L==2 // de
@ -52834,7 +52834,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Post sociais" "Post sociais"
#endif #endif
, ,
[TL_NOTE_FORUM_POST] = [Tml_NOTE_FORUM_POST] =
#if L==1 // ca #if L==1 // ca
"Comentari en un f&ograve;rum" "Comentari en un f&ograve;rum"
#elif L==2 // de #elif L==2 // de
@ -52855,7 +52855,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] =
"Post em um f&oacute;rum" "Post em um f&oacute;rum"
#endif #endif
, ,
[TL_NOTE_NOTICE] = [Tml_NOTE_NOTICE] =
#if L==1 // ca #if L==1 // ca
"Av&iacute;s" "Av&iacute;s"
#elif L==2 // de #elif L==2 // de

View File

@ -534,7 +534,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowe prosby o rejestracji", [Lan_LANGUAGE_PL ] = "Nowe prosby o rejestracji",
[Lan_LANGUAGE_PT ] = "Novo pedido de inscrição", [Lan_LANGUAGE_PT ] = "Novo pedido de inscrição",
}, },
[Ntf_EVENT_TL_COMMENT] = [Ntf_EVENT_TML_COMMENT] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nou comentari a un missatge social", [Lan_LANGUAGE_CA ] = "Nou comentari a un missatge social",
@ -547,7 +547,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowy komentarz do post spoleczna", [Lan_LANGUAGE_PL ] = "Nowy komentarz do post spoleczna",
[Lan_LANGUAGE_PT ] = "Novo comentário a um post sociais", [Lan_LANGUAGE_PT ] = "Novo comentário a um post sociais",
}, },
[Ntf_EVENT_TL_FAV] = [Ntf_EVENT_TML_FAV] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nou favorit a un missatge social", [Lan_LANGUAGE_CA ] = "Nou favorit a un missatge social",
@ -560,7 +560,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowy ulubiony do post spoleczna", [Lan_LANGUAGE_PL ] = "Nowy ulubiony do post spoleczna",
[Lan_LANGUAGE_PT ] = "Novo favorito a um post sociais", [Lan_LANGUAGE_PT ] = "Novo favorito a um post sociais",
}, },
[Ntf_EVENT_TL_SHARE] = [Ntf_EVENT_TML_SHARE] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nova compartició de missatge social", [Lan_LANGUAGE_CA ] = "Nova compartició de missatge social",
@ -573,7 +573,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowy podzial post spoleczna", [Lan_LANGUAGE_PL ] = "Nowy podzial post spoleczna",
[Lan_LANGUAGE_PT ] = "Nova partilha de post sociais", [Lan_LANGUAGE_PT ] = "Nova partilha de post sociais",
}, },
[Ntf_EVENT_TL_MENTION] = [Ntf_EVENT_TML_MENTION] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nova menció", [Lan_LANGUAGE_CA ] = "Nova menció",

View File

@ -376,7 +376,8 @@ static void Tml_GetAndShowOldTimeline (struct Tml_Timeline *Timeline)
/*****************************************************************************/ /*****************************************************************************/
/******************************* Show timeline *******************************/ /******************************* Show timeline *******************************/
/*****************************************************************************/ /*****************************************************************************/
/* _____ /*
_____
/ |_____| just_now_timeline_list (Posts retrieved automatically / |_____| just_now_timeline_list (Posts retrieved automatically
| |_____| via AJAX from time to time. | |_____| via AJAX from time to time.
| |_____| They are transferred inmediately | |_____| They are transferred inmediately
@ -479,7 +480,7 @@ static unsigned Tml_ListRecentPubs (struct Tml_Timeline *Timeline,
struct Tml_Not_Note Not; struct Tml_Not_Note Not;
/***** Begin list *****/ /***** Begin list *****/
HTM_UL_Begin ("id=\"timeline_list\" class=\"TL_LIST\""); HTM_UL_Begin ("id=\"timeline_list\" class=\"Tml_LIST\"");
/***** For each publication in list... *****/ /***** For each publication in list... *****/
for (Pub = Timeline->Pubs.Top, NumNotesShown = 0; for (Pub = Timeline->Pubs.Top, NumNotesShown = 0;
@ -492,8 +493,8 @@ static unsigned Tml_ListRecentPubs (struct Tml_Timeline *Timeline,
/* Write list item (note) */ /* Write list item (note) */
HTM_LI_Begin ("class=\"%s\"", HTM_LI_Begin ("class=\"%s\"",
Not.NotCod == NotCodToHighlight ? "TL_WIDTH TL_SEP TL_NEW_PUB" : Not.NotCod == NotCodToHighlight ? "Tml_WIDTH Tml_SEP Tml_NEW_PUB" :
"TL_WIDTH TL_SEP"); "Tml_WIDTH Tml_SEP");
Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not, Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not,
Tml_Pub_GetTopMessage (Pub->Type), Tml_Pub_GetTopMessage (Pub->Type),
Pub->PublisherCod); Pub->PublisherCod);
@ -512,7 +513,7 @@ static unsigned Tml_ListRecentPubs (struct Tml_Timeline *Timeline,
static void Tml_PutHiddenList (const char *Id) static void Tml_PutHiddenList (const char *Id)
{ {
HTM_UL_Begin ("id=\"%s\" class=\"TL_LIST\"",Id); HTM_UL_Begin ("id=\"%s\" class=\"Tml_LIST\"",Id);
HTM_UL_End (); HTM_UL_End ();
} }
@ -529,7 +530,7 @@ void Tml_WriteDateTime (time_t TimeUTC)
Frm_SetUniqueId (IdDateTime); Frm_SetUniqueId (IdDateTime);
/***** Container where the date-time is written *****/ /***** Container where the date-time is written *****/
HTM_DIV_Begin ("id=\"%s\" class=\"TL_RIGHT_TIME DAT_LIGHT\"",IdDateTime); HTM_DIV_Begin ("id=\"%s\" class=\"Tml_RIGHT_TIME DAT_LIGHT\"",IdDateTime);
HTM_DIV_End (); HTM_DIV_End ();
/***** Script to write date and time in browser local time *****/ /***** Script to write date and time in browser local time *****/

View File

@ -37,12 +37,12 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define TL_TIMELINE_SECTION_ID "timeline" #define Tml_TIMELINE_SECTION_ID "timeline"
/* /*
Timeline images will be saved with: Timeline images will be saved with:
· maximum width of TL_IMAGE_SAVED_MAX_HEIGHT · maximum width of Tml_IMAGE_SAVED_MAX_HEIGHT
· maximum height of TL_IMAGE_SAVED_MAX_HEIGHT · maximum height of Tml_IMAGE_SAVED_MAX_HEIGHT
· maintaining the original aspect ratio (aspect ratio recommended: 3:2) · maintaining the original aspect ratio (aspect ratio recommended: 3:2)
*/ */
#define Tml_IMAGE_SAVED_MAX_WIDTH 768 #define Tml_IMAGE_SAVED_MAX_WIDTH 768

View File

@ -119,7 +119,7 @@ void Tml_Com_PutIconToToggleComm (const char UniqueId[Frm_MAX_BYTES_ID + 1])
/***** Link to toggle on/off the form to comment a note *****/ /***** Link to toggle on/off the form to comment a note *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("id=\"%s_ico\" class=\"TL_ICO_COM_OFF\"",UniqueId); HTM_DIV_Begin ("id=\"%s_ico\" class=\"Tml_ICO_COM_OFF\"",UniqueId);
/* Begin anchor */ /* Begin anchor */
HTM_A_Begin ("href=\"\" onclick=\"toggleNewComment ('%s');" HTM_A_Begin ("href=\"\" onclick=\"toggleNewComment ('%s');"
@ -146,7 +146,7 @@ void Tml_Com_PutIconCommDisabled (void)
/***** Disabled icon to comment a note *****/ /***** Disabled icon to comment a note *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_ICO_COM_OFF TL_ICO_DISABLED\""); HTM_DIV_Begin ("class=\"Tml_ICO_COM_OFF Tml_ICO_DISABLED\"");
/* Disabled icon */ /* Disabled icon */
Ico_PutIcon ("edit.svg",Txt_Comment,"ICO16x16"); Ico_PutIcon ("edit.svg",Txt_Comment,"ICO16x16");
@ -164,7 +164,7 @@ void Tml_Com_PutPhotoAndFormToWriteNewComm (const struct Tml_Timeline *Timeline,
const char IdNewComm[Frm_MAX_BYTES_ID + 1]) const char IdNewComm[Frm_MAX_BYTES_ID + 1])
{ {
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("id=\"%s\" class=\"TL_FORM_NEW_COM TL_RIGHT_WIDTH\"" HTM_DIV_Begin ("id=\"%s\" class=\"Tml_FORM_NEW_COM Tml_RIGHT_WIDTH\""
" style=\"display:none;\"", " style=\"display:none;\"",
IdNewComm); IdNewComm);
@ -186,7 +186,7 @@ static void Tml_Com_ShowAuthorPhoto (struct UsrData *UsrDat)
{ {
/***** Show author's photo *****/ /***** Show author's photo *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_COM_PHOTO\""); HTM_DIV_Begin ("class=\"Tml_COM_PHOTO\"");
/* Author's photo */ /* Author's photo */
Pho_ShowUsrPhotoIfAllowed (UsrDat,"PHOTO30x40",Pho_ZOOM,true); // Use unique id Pho_ShowUsrPhotoIfAllowed (UsrDat,"PHOTO30x40",Pho_ZOOM,true); // Use unique id
@ -205,7 +205,7 @@ static void Tml_Com_PutFormToWriteNewComm (const struct Tml_Timeline *Timeline,
extern const char *Txt_New_TIMELINE_comment; extern const char *Txt_New_TIMELINE_comment;
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"TL_COM_CONT TL_COMM_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_COM_CONT Tml_COMM_WIDTH\"");
/***** Begin form to write the post *****/ /***** Begin form to write the post *****/
Tml_Frm_BeginForm (Timeline,Tml_Frm_RECEIVE_COMM); Tml_Frm_BeginForm (Timeline,Tml_Frm_RECEIVE_COMM);
@ -213,7 +213,7 @@ static void Tml_Com_PutFormToWriteNewComm (const struct Tml_Timeline *Timeline,
/***** Textarea and button *****/ /***** Textarea and button *****/
Tml_Pst_PutTextarea (Txt_New_TIMELINE_comment, Tml_Pst_PutTextarea (Txt_New_TIMELINE_comment,
"TL_COM_TEXTAREA TL_COMM_WIDTH"); "Tml_COM_TEXTAREA Tml_COMM_WIDTH");
/***** End form *****/ /***** End form *****/
Tml_Frm_EndForm (); Tml_Frm_EndForm ();
@ -283,7 +283,8 @@ void Tml_Com_WriteCommsInNote (const struct Tml_Timeline *Timeline,
| | | |_____________________________| | | | | |_____________________________| |
| _____________________________ | | _____________________________ | | _____________________________ | | _____________________________ |
| | div exp_<id> | | | | div exp_<id> | | | | div exp_<id> | | | | div exp_<id> | |
| | _________________________ | | | | (hidden) | | | | (visible) | | | | (hidden) | |
| | _________________________ | | | | | |
| | | form | | | | | | | | | | form | | | | | | |
| | | _____________________ | | | | | _____________________ | | | | | _____________________ | | | | | _____________________ | |
| | | | ^ See prev.comments | | | | | | | ^ See prev.comments | | | | | | | ^ See prev.comments | | | | | | | ^ See prev.comments | | |
@ -319,7 +320,7 @@ void Tml_Com_WriteCommsInNote (const struct Tml_Timeline *Timeline,
/***** List final visible comments *****/ /***** List final visible comments *****/
if (NumFinalComms) if (NumFinalComms)
{ {
HTM_UL_Begin ("class=\"TL_LIST\""); // Never hidden, always visible HTM_UL_Begin ("class=\"Tml_LIST\""); // Never hidden, always visible
Tml_Com_ListComms (Timeline,NumFinalComms,mysql_res); Tml_Com_ListComms (Timeline,NumFinalComms,mysql_res);
HTM_UL_End (); HTM_UL_End ();
} }
@ -385,7 +386,7 @@ static unsigned Tml_Com_WriteHiddenComms (struct Tml_Timeline *Timeline,
&mysql_res); &mysql_res);
/***** List comments *****/ /***** List comments *****/
HTM_UL_Begin ("id=\"com_%s\" class=\"TL_LIST\"",IdComms); HTM_UL_Begin ("id=\"com_%s\" class=\"Tml_LIST\"",IdComms);
Tml_Com_ListComms (Timeline,NumInitialCommsGot,mysql_res); Tml_Com_ListComms (Timeline,NumInitialCommsGot,mysql_res);
HTM_UL_End (); HTM_UL_End ();
@ -429,7 +430,7 @@ static void Tml_Com_WriteOneCommInList (const struct Tml_Timeline *Timeline,
Tml_Com_GetDataOfCommFromRow (row,&Com); Tml_Com_GetDataOfCommFromRow (row,&Com);
/***** Write comment *****/ /***** Write comment *****/
HTM_LI_Begin ("class=\"TL_COM\""); HTM_LI_Begin ("class=\"Tml_COM\"");
Tml_Com_CheckAndWriteComm (Timeline,&Com); Tml_Com_CheckAndWriteComm (Timeline,&Com);
HTM_LI_End (); HTM_LI_End ();
@ -447,31 +448,36 @@ static void Tml_Com_LinkToShowComms (Tml_Com_ContractExpand_t ConExp,
{ {
extern const char *Txt_See_only_the_latest_X_COMMENTS; extern const char *Txt_See_only_the_latest_X_COMMENTS;
extern const char *Txt_See_the_previous_X_COMMENTS; extern const char *Txt_See_the_previous_X_COMMENTS;
static const char *Id[Tml_Com_NUM_CONTRACT_EXPAND] = static const struct
{ {
"con", // contract const char *Id;
"exp", // expand const char *Icon;
}; const char **Text;
static const char *Icon[Tml_Com_NUM_CONTRACT_EXPAND] = } Link[Tml_Com_NUM_CONTRACT_EXPAND] =
{ {
"angle-down.svg", // contract [Tml_Com_CONTRACT] =
"angle-up.svg", // expand {
}; .Id = "con",
const char *Text[Tml_Com_NUM_CONTRACT_EXPAND] = .Icon = "angle-down.svg",
{ .Text = &Txt_See_only_the_latest_X_COMMENTS,
Txt_See_only_the_latest_X_COMMENTS, // contract },
Txt_See_the_previous_X_COMMENTS, // expand [Tml_Com_EXPAND] =
{
.Id = "exp",
.Icon = "angle-up.svg",
.Text = &Txt_See_the_previous_X_COMMENTS,
},
}; };
/***** Icon and text to show only the latest comments ****/ /***** Link (icon and text) to show comments ****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("id=\"%s_%s\" class=\"TL_EXPAND_COM TL_RIGHT_WIDTH\"" HTM_DIV_Begin ("id=\"%s_%s\" class=\"Tml_EXPAND_COM Tml_RIGHT_WIDTH\""
" style=\"display:none;\"", // Hidden " style=\"display:none;\"", // Hidden
Id[ConExp],IdComms); Link[ConExp].Id,IdComms);
/* Icon and text */ /* Icon and text */
Tml_Com_PutIconToToggleComms (IdComms,Icon[ConExp], Tml_Com_PutIconToToggleComms (IdComms,Link[ConExp].Icon,
Str_BuildStringLong (Text[ConExp],(long) NumComms)); Str_BuildStringLong (*Link[ConExp].Text,(long) NumComms));
Str_FreeString (); Str_FreeString ();
/* End container */ /* End container */
@ -508,7 +514,8 @@ static void Tml_Com_PutIconToToggleComms (const char *UniqueId,
static void Tml_Com_CheckAndWriteComm (const struct Tml_Timeline *Timeline, static void Tml_Com_CheckAndWriteComm (const struct Tml_Timeline *Timeline,
struct Tml_Com_Comment *Com) struct Tml_Com_Comment *Com)
{ {
/*__________________________________________ /*
___________________________________________
| _____ | | | \ \ | _____ | | | \ \
|| | | Author's name | Date-time | | | || | | Author's name | Date-time | | |
||Auth.| |______________________|___________| | | ||Auth.| |______________________|___________| | |
@ -557,7 +564,7 @@ static void Tml_Com_WriteComm (const struct Tml_Timeline *Timeline,
/***** Right: author's name, time, content, and buttons *****/ /***** Right: author's name, time, content, and buttons *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_COM_CONT TL_COMM_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_COM_CONT Tml_COMM_WIDTH\"");
/* Right top: author's name, time, and content */ /* Right top: author's name, time, and content */
Tml_Com_WriteAuthorTimeAndContent (Com,&UsrDat); Tml_Com_WriteAuthorTimeAndContent (Com,&UsrDat);
@ -606,7 +613,7 @@ static void Tml_Com_WriteAuthorName (const struct UsrData *UsrDat) // Author
/* Author's name */ /* Author's name */
HTM_BUTTON_SUBMIT_Begin (Usr_ItsMe (UsrDat->UsrCod) ? Txt_My_public_profile : HTM_BUTTON_SUBMIT_Begin (Usr_ItsMe (UsrDat->UsrCod) ? Txt_My_public_profile :
Txt_Another_user_s_profile, Txt_Another_user_s_profile,
"BT_LINK TL_COM_AUTHOR TL_COMM_AUTHOR_WIDTH DAT_BOLD",NULL); "BT_LINK Tml_COM_AUTHOR Tml_COMM_AUTHOR_WIDTH DAT_BOLD",NULL);
HTM_Txt (UsrDat->FullName); HTM_Txt (UsrDat->FullName);
HTM_BUTTON_End (); HTM_BUTTON_End ();
@ -623,14 +630,14 @@ static void Tml_Com_WriteContent (struct Tml_Com_Comment *Com)
/***** Write content of the comment *****/ /***** Write content of the comment *****/
if (Com->Content.Txt[0]) if (Com->Content.Txt[0])
{ {
HTM_DIV_Begin ("class=\"TL_TXT\""); HTM_DIV_Begin ("class=\"Tml_TXT\"");
Msg_WriteMsgContent (Com->Content.Txt,Cns_MAX_BYTES_LONG_TEXT,true,false); Msg_WriteMsgContent (Com->Content.Txt,Cns_MAX_BYTES_LONG_TEXT,true,false);
HTM_DIV_End (); HTM_DIV_End ();
} }
/***** Show image *****/ /***** Show image *****/
Med_ShowMedia (&Com->Content.Media,"TL_COM_MED_CONT TL_COMM_WIDTH", Med_ShowMedia (&Com->Content.Media,"Tml_COM_MED_CONT Tml_COMM_WIDTH",
"TL_COM_MED TL_COMM_WIDTH"); "Tml_COM_MED Tml_COMM_WIDTH");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -646,10 +653,10 @@ static void Tml_Com_WriteButtons (const struct Tml_Timeline *Timeline,
NumDiv++; NumDiv++;
/***** Begin buttons container *****/ /***** Begin buttons container *****/
HTM_DIV_Begin ("class=\"TL_FOOT TL_COMM_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_FOOT Tml_COMM_WIDTH\"");
/***** Foot column 1: fav zone *****/ /***** Foot column 1: fav zone *****/
HTM_DIV_Begin ("id=\"fav_com_%s_%u\" class=\"TL_FAV_COM TL_FAV_WIDTH\"", HTM_DIV_Begin ("id=\"fav_com_%s_%u\" class=\"Tml_FAV_COM Tml_FAV_WIDTH\"",
Gbl.UniqueNameEncrypted,NumDiv); Gbl.UniqueNameEncrypted,NumDiv);
Tml_Usr_PutIconFavSha (Tml_Usr_FAV_UNF_COMM, Tml_Usr_PutIconFavSha (Tml_Usr_FAV_UNF_COMM,
Com->PubCod,Com->UsrCod,Com->NumFavs, Com->PubCod,Com->UsrCod,Com->NumFavs,
@ -657,7 +664,7 @@ static void Tml_Com_WriteButtons (const struct Tml_Timeline *Timeline,
HTM_DIV_End (); HTM_DIV_End ();
/***** Foot column 2: icon to remove this comment *****/ /***** Foot column 2: icon to remove this comment *****/
HTM_DIV_Begin ("class=\"TL_REM\""); HTM_DIV_Begin ("class=\"Tml_REM\"");
if (Usr_ItsMe (UsrDat->UsrCod)) // I am the author if (Usr_ItsMe (UsrDat->UsrCod)) // I am the author
Tml_Com_PutFormToRemoveComm (Timeline,Com->PubCod); Tml_Com_PutFormToRemoveComm (Timeline,Com->PubCod);
HTM_DIV_End (); HTM_DIV_End ();
@ -706,7 +713,7 @@ void Tml_Com_ReceiveCommUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Receive comment in a note /***** Receive comment in a note
and write updated timeline after commenting (user) *****/ and write updated timeline after commenting (user) *****/
@ -774,14 +781,14 @@ static long Tml_Com_ReceiveComm (void)
/* Insert into publications */ /* Insert into publications */
Pub.NotCod = Not.NotCod; Pub.NotCod = Not.NotCod;
Pub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; Pub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Pub.Type = Tml_Pub_COMMENT_TO_NOTE; Pub.Type = Tml_Pub_COMMENT_TO_NOTE;
Tml_Pub_PublishPubInTimeline (&Pub); // Set Pub.PubCod Tml_Pub_PublishPubInTimeline (&Pub); // Set Pub.PubCod
/* Insert comment content in the database */ /* Insert comment content in the database */
Tml_DB_InsertCommContent (Pub.PubCod,&Content); Tml_DB_InsertCommContent (Pub.PubCod,&Content);
/***** Store notifications about the new comment *****/ /***** Store notifications about the new comment *****/
Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TL_COMMENT,Pub.PubCod); Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TML_COMMENT,Pub.PubCod);
/***** Analyze content and store notifications about mentions *****/ /***** Analyze content and store notifications about mentions *****/
Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt);
@ -811,7 +818,7 @@ void Tml_Com_RequestRemComUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Request the removal of comment in note *****/ /***** Request the removal of comment in note *****/
Tml_Com_RequestRemovalComm (&Timeline); Tml_Com_RequestRemovalComm (&Timeline);
@ -866,11 +873,11 @@ static void Tml_Com_RequestRemovalComm (struct Tml_Timeline *Timeline)
NULL,Box_NOT_CLOSABLE); NULL,Box_NOT_CLOSABLE);
/* Indent the comment */ /* Indent the comment */
HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\""); HTM_DIV_Begin ("class=\"Tml_LEFT_PHOTO\"");
HTM_DIV_End (); HTM_DIV_End ();
/* Show the comment */ /* Show the comment */
HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\"");
Tml_Com_CheckAndWriteComm (Timeline,&Com); Tml_Com_CheckAndWriteComm (Timeline,&Com);
HTM_DIV_End (); HTM_DIV_End ();
@ -920,7 +927,7 @@ void Tml_Com_RemoveComUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Remove a comment *****/ /***** Remove a comment *****/
Tml_Com_RemoveComm (); Tml_Com_RemoveComm ();
@ -999,9 +1006,9 @@ void Tml_Com_RemoveCommMediaAndDBEntries (long PubCod)
Med_RemoveMedia (Tml_DB_GetMedCodFromComm (PubCod)); Med_RemoveMedia (Tml_DB_GetMedCodFromComm (PubCod));
/***** Mark possible notifications on this comment as removed *****/ /***** Mark possible notifications on this comment as removed *****/
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_COMMENT,PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_COMMENT,PubCod);
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV ,PubCod);
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_MENTION,PubCod);
/***** Remove favs for this comment *****/ /***** Remove favs for this comment *****/
Tml_DB_RemoveCommFavs (PubCod); Tml_DB_RemoveCommFavs (PubCod);

View File

@ -640,7 +640,7 @@ void Tml_DB_RemoveAllPostsUsr (long UsrCod)
" FROM tml_notes" " FROM tml_notes"
" WHERE UsrCod=%ld" " WHERE UsrCod=%ld"
" AND NoteType=%u)", " AND NoteType=%u)",
UsrCod,(unsigned) TL_NOTE_POST); UsrCod,(unsigned) Tml_NOTE_POST);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -151,9 +151,8 @@ static void Tml_Fav_FavNote (struct Tml_Not_Note *Not)
/***** Create notification about favourite post /***** Create notification about favourite post
for the author of the post *****/ for the author of the post *****/
OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if ((OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod)) > 0)
if (OriginalPubCod > 0) Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TML_FAV);
Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_FAV);
} }
static void Tml_Fav_UnfNote (struct Tml_Not_Note *Not) static void Tml_Fav_UnfNote (struct Tml_Not_Note *Not)
@ -181,9 +180,8 @@ static void Tml_Fav_UnfNote (struct Tml_Not_Note *Not)
Not->NotCod,Not->UsrCod); Not->NotCod,Not->UsrCod);
/***** Mark possible notifications on this note as removed *****/ /***** Mark possible notifications on this note as removed *****/
OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if ((OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod)) > 0)
if (OriginalPubCod > 0) Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV,OriginalPubCod);
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,OriginalPubCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -296,7 +294,7 @@ static void Tml_Fav_FavComm (struct Tml_Com_Comment *Com)
/***** Create notification about favourite post /***** Create notification about favourite post
for the author of the post *****/ for the author of the post *****/
Tml_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TL_FAV); Tml_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TML_FAV);
/***** Free image *****/ /***** Free image *****/
Med_MediaDestructor (&Com->Content.Media); Med_MediaDestructor (&Com->Content.Media);
@ -334,7 +332,7 @@ static void Tml_Fav_UnfComm (struct Tml_Com_Comment *Com)
Com->PubCod,Com->UsrCod); Com->PubCod,Com->UsrCod);
/***** Mark possible notifications on this comment as removed *****/ /***** Mark possible notifications on this comment as removed *****/
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,Com->PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV,Com->PubCod);
/***** Free image *****/ /***** Free image *****/
Med_MediaDestructor (&Com->Content.Media); Med_MediaDestructor (&Com->Content.Media);

View File

@ -98,7 +98,7 @@ void Tml_Frm_PutFormToFavUnfShaUns (Tml_Usr_FavSha_t FavSha,long Cod)
extern const char *Txt_TIMELINE_Favourite; extern const char *Txt_TIMELINE_Favourite;
extern const char *Txt_TIMELINE_Share; extern const char *Txt_TIMELINE_Share;
extern const char *Txt_TIMELINE_Shared; extern const char *Txt_TIMELINE_Shared;
struct TL_Form Form[Tml_Usr_NUM_FAV_SHA][2] = struct Tml_Form Form[Tml_Usr_NUM_FAV_SHA][2] =
{ {
[Tml_Usr_FAV_UNF_NOTE] = [Tml_Usr_FAV_UNF_NOTE] =
{ {
@ -200,7 +200,7 @@ void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action,
Tml_Usr_HowManyUsrs_t HowManyUsrs) Tml_Usr_HowManyUsrs_t HowManyUsrs)
{ {
extern const char *Txt_View_all_USERS; extern const char *Txt_View_all_USERS;
struct TL_Form Form = struct Tml_Form Form =
{ {
.Action = Action, .Action = Action,
.ParamFormat = ParamFormat, .ParamFormat = ParamFormat,
@ -226,27 +226,28 @@ void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action,
/******* Form to fav/unfav or share/unshare in global or user timeline *******/ /******* Form to fav/unfav or share/unshare in global or user timeline *******/
/*****************************************************************************/ /*****************************************************************************/
void Tml_Frm_FormFavSha (const struct TL_Form *Form) void Tml_Frm_FormFavSha (const struct Tml_Form *Form)
{ {
char *OnSubmit; char *OnSubmit;
const char *Anchor;
char ParamStr[7 + Cns_MAX_DECIMAL_DIGITS_LONG + 1]; char ParamStr[7 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
/***** Create parameter string *****/ /***** Create parameter string *****/
sprintf (ParamStr,Form->ParamFormat,Form->ParamCod); sprintf (ParamStr,Form->ParamFormat,Form->ParamCod);
/* /*
+---------------------------------------------------------------------------+ ___________________________________________________________________________
| div which content will be updated (parent of parent of form) | | div which content will be updated (parent of parent of form) |
| +---------------------+ +-------+ +-------------------------------------+ | | _____________________ _______ _____________________________________ |
| | div (parent of form)| | div | | div for users | | | | div (parent of form)| | div | | div for users | |
| | +-----------------+ | | for | | +------+ +------+ +------+ +------+ | | | | _________________ | | for | | ______ ______ ______ ______ | |
| | | this form | | | num. | | | | | | | | | form | | | | | | this form | | | num. | | | | | | | | | form | | |
| | | +-------------+ | | | of | | | user | | user | | user | | to | | | | | | _____________ | | | of | | | user | | user | | user | | to | | |
| | | | fav icon | | | | users | | | 1 | | 2 | | 3 | | show | | | | | | | fav icon | | | | users | | | 1 | | 2 | | 3 | | show | | |
| | | +-------------+ | | | | | | | | | | | | all | | | | | | |_____________| | | | | | | | | | | | | all | | |
| | +-----------------+ | | | | +------+ +------+ +------+ +------+ | | | | |_________________| | | | | |______| |______| |______| |______| | |
| +---------------------+ +-------+ +-------------------------------------+ | | |_____________________| |_______| |_____________________________________| |
+---------------------------------------------------------------------------+ |___________________________________________________________________________|
*/ */
/***** Form and icon to mark note as favourite *****/ /***** Form and icon to mark note as favourite *****/
@ -261,7 +262,7 @@ void Tml_Frm_FormFavSha (const struct TL_Form *Form)
ParamStr, ParamStr,
Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0) Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0)
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,"timeline",OnSubmit); Anchor = "timeline";
} }
else else
{ {
@ -272,13 +273,12 @@ void Tml_Frm_FormFavSha (const struct TL_Form *Form)
Gbl.Session.Id, Gbl.Session.Id,
ParamStr) < 0) ParamStr) < 0)
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,NULL,OnSubmit); Anchor = NULL;
} }
Ico_PutIconLink (Form->Icon,Form->Title); Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,Anchor,OnSubmit);
Frm_EndForm ();
/* Free allocated memory */
free (OnSubmit); free (OnSubmit);
Ico_PutIconLink (Form->Icon,Form->Title);
Frm_EndForm ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -292,12 +292,13 @@ void Tml_Frm_FormToShowHiddenComms (long NotCod,
extern const char *The_ClassFormLinkInBox[The_NUM_THEMES]; extern const char *The_ClassFormLinkInBox[The_NUM_THEMES];
extern const char *Txt_See_the_previous_X_COMMENTS; extern const char *Txt_See_the_previous_X_COMMENTS;
char *OnSubmit; char *OnSubmit;
const char *Anchor;
/***** Begin container which content will be updated via AJAX *****/ /***** Begin container which content will be updated via AJAX *****/
HTM_DIV_Begin ("id=\"%s\" class=\"TL_RIGHT_WIDTH\"",IdComms); HTM_DIV_Begin ("id=\"%s\" class=\"Tml_RIGHT_WIDTH\"",IdComms);
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("id=\"exp_%s\" class=\"TL_EXPAND_COM TL_RIGHT_WIDTH\"", HTM_DIV_Begin ("id=\"exp_%s\" class=\"Tml_EXPAND_COM Tml_RIGHT_WIDTH\"",
IdComms); IdComms);
/***** Form and icon-text to show hidden comments *****/ /***** Form and icon-text to show hidden comments *****/
@ -316,7 +317,7 @@ void Tml_Frm_FormToShowHiddenComms (long NotCod,
NumInitialComms, NumInitialComms,
Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0) Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0)
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,"timeline",OnSubmit); Anchor = "timeline";
} }
else else
{ {
@ -331,23 +332,22 @@ void Tml_Frm_FormToShowHiddenComms (long NotCod,
IdComms, IdComms,
NumInitialComms) < 0) NumInitialComms) < 0)
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,NULL,OnSubmit); Anchor = NULL;
} }
Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,Anchor,OnSubmit);
free (OnSubmit);
/* Put icon and text with link to show the first hidden comments */ /* Put icon and text with link to show the first hidden comments */
HTM_BUTTON_SUBMIT_Begin (NULL,The_ClassFormLinkInBox[Gbl.Prefs.Theme],NULL); HTM_BUTTON_SUBMIT_Begin (NULL,The_ClassFormLinkInBox[Gbl.Prefs.Theme],NULL);
Ico_PutIconTextLink ("angle-up.svg", Ico_PutIconTextLink ("angle-up.svg",
Str_BuildStringLong (Txt_See_the_previous_X_COMMENTS, Str_BuildStringLong (Txt_See_the_previous_X_COMMENTS,
(long) NumInitialComms)); (long) NumInitialComms));
Str_FreeString (); Str_FreeString ();
HTM_BUTTON_End (); HTM_BUTTON_End ();
/* End form */ /* End form */
Frm_EndForm (); Frm_EndForm ();
/* Free allocated memory */
free (OnSubmit);
/***** End container *****/ /***** End container *****/
HTM_DIV_End (); HTM_DIV_End ();

View File

@ -56,7 +56,7 @@ typedef enum
Tml_Frm_SHO_HID_COMM, // Show / hide comments Tml_Frm_SHO_HID_COMM, // Show / hide comments
} Tml_Frm_Action_t; } Tml_Frm_Action_t;
struct TL_Form struct Tml_Form
{ {
Tml_Frm_Action_t Action; Tml_Frm_Action_t Action;
const char *ParamFormat; const char *ParamFormat;
@ -78,7 +78,7 @@ void Tml_Frm_EndForm (void);
void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action, void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action,
const char *ParamFormat,long ParamCod, const char *ParamFormat,long ParamCod,
Tml_Usr_HowManyUsrs_t HowManyUsrs); Tml_Usr_HowManyUsrs_t HowManyUsrs);
void Tml_Frm_FormFavSha (const struct TL_Form *Form); void Tml_Frm_FormFavSha (const struct Tml_Form *Form);
void Tml_Frm_FormToShowHiddenComms (long NotCod, void Tml_Frm_FormToShowHiddenComms (long NotCod,
char IdComms[Frm_MAX_BYTES_ID + 1], char IdComms[Frm_MAX_BYTES_ID + 1],

View File

@ -59,14 +59,14 @@ extern struct Globals Gbl;
static const Tml_Not_Type_t Tml_Not_NoteType[Brw_NUM_TYPES_FILE_BROWSER] = static const Tml_Not_Type_t Tml_Not_NoteType[Brw_NUM_TYPES_FILE_BROWSER] =
{ {
[Brw_ADMI_DOC_INS] = TL_NOTE_INS_DOC_PUB_FILE, [Brw_ADMI_DOC_INS] = Tml_NOTE_INS_DOC_PUB_FILE,
[Brw_ADMI_SHR_INS] = TL_NOTE_INS_SHA_PUB_FILE, [Brw_ADMI_SHR_INS] = Tml_NOTE_INS_SHA_PUB_FILE,
[Brw_ADMI_DOC_CTR] = TL_NOTE_CTR_DOC_PUB_FILE, [Brw_ADMI_DOC_CTR] = Tml_NOTE_CTR_DOC_PUB_FILE,
[Brw_ADMI_SHR_CTR] = TL_NOTE_CTR_SHA_PUB_FILE, [Brw_ADMI_SHR_CTR] = Tml_NOTE_CTR_SHA_PUB_FILE,
[Brw_ADMI_DOC_DEG] = TL_NOTE_DEG_DOC_PUB_FILE, [Brw_ADMI_DOC_DEG] = Tml_NOTE_DEG_DOC_PUB_FILE,
[Brw_ADMI_SHR_DEG] = TL_NOTE_DEG_SHA_PUB_FILE, [Brw_ADMI_SHR_DEG] = Tml_NOTE_DEG_SHA_PUB_FILE,
[Brw_ADMI_DOC_CRS] = TL_NOTE_CRS_DOC_PUB_FILE, [Brw_ADMI_DOC_CRS] = Tml_NOTE_CRS_DOC_PUB_FILE,
[Brw_ADMI_SHR_CRS] = TL_NOTE_CRS_SHA_PUB_FILE, [Brw_ADMI_SHR_CRS] = Tml_NOTE_CRS_SHA_PUB_FILE,
}; };
/*****************************************************************************/ /*****************************************************************************/
@ -131,10 +131,10 @@ void Tml_Not_ShowHighlightedNote (struct Tml_Timeline *Timeline,
{ {
[Ntf_EVENT_UNKNOWN ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_UNKNOWN ] = Tml_TOP_MESSAGE_NONE,
/* Start tab */ /* Start tab */
[Ntf_EVENT_TL_COMMENT ] = Tml_TOP_MESSAGE_COMMENTED, [Ntf_EVENT_TML_COMMENT ] = Tml_TOP_MESSAGE_COMMENTED,
[Ntf_EVENT_TL_FAV ] = Tml_TOP_MESSAGE_FAVED, [Ntf_EVENT_TML_FAV ] = Tml_TOP_MESSAGE_FAVED,
[Ntf_EVENT_TL_SHARE ] = Tml_TOP_MESSAGE_SHARED, [Ntf_EVENT_TML_SHARE ] = Tml_TOP_MESSAGE_SHARED,
[Ntf_EVENT_TL_MENTION ] = Tml_TOP_MESSAGE_MENTIONED, [Ntf_EVENT_TML_MENTION ] = Tml_TOP_MESSAGE_MENTIONED,
[Ntf_EVENT_FOLLOWER ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_FOLLOWER ] = Tml_TOP_MESSAGE_NONE,
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -145,7 +145,7 @@ void Tml_Not_ShowHighlightedNote (struct Tml_Timeline *Timeline,
/* Assessment tab */ /* Assessment tab */
[Ntf_EVENT_ASSIGNMENT ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_ASSIGNMENT ] = Tml_TOP_MESSAGE_NONE,
[Ntf_EVENT_SURVEY ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_SURVEY ] = Tml_TOP_MESSAGE_NONE,
[Ntf_EVENT_CALL_FOR_EXAM] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_CALL_FOR_EXAM ] = Tml_TOP_MESSAGE_NONE,
/* Files tab */ /* Files tab */
[Ntf_EVENT_DOCUMENT_FILE ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_DOCUMENT_FILE ] = Tml_TOP_MESSAGE_NONE,
[Ntf_EVENT_TEACHERS_FILE ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_TEACHERS_FILE ] = Tml_TOP_MESSAGE_NONE,
@ -183,7 +183,7 @@ void Tml_Not_ShowHighlightedNote (struct Tml_Timeline *Timeline,
NULL,Box_CLOSABLE); NULL,Box_CLOSABLE);
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_WIDTH TL_NEW_PUB\""); HTM_DIV_Begin ("class=\"Tml_WIDTH Tml_NEW_PUB\"");
/* Check and write note with top message */ /* Check and write note with top message */
Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,Not, Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,Not,
@ -206,7 +206,8 @@ void Tml_Not_CheckAndWriteNoteWithTopMsg (const struct Tml_Timeline *Timeline,
Tml_TopMessage_t TopMessage, Tml_TopMessage_t TopMessage,
long PublisherCod) // Who did the action (publication, commenting, faving, sharing, mentioning) long PublisherCod) // Who did the action (publication, commenting, faving, sharing, mentioning)
{ {
/*__________________________________________ /*
___________________________________________
| | \ | | \
| Top message: | > top message | Top message: | > top message
|___________________________________________| / |___________________________________________| /
@ -232,9 +233,9 @@ void Tml_Not_CheckAndWriteNoteWithTopMsg (const struct Tml_Timeline *Timeline,
|__________________________________| / / |__________________________________| / /
*/ */
/***** Trivial check: codes *****/ /***** Trivial check: codes *****/
if (Not->NotCod <= 0 || if (Not->NotCod <= 0 ||
Not->UsrCod <= 0 || Not->UsrCod <= 0 ||
Not->Type == TL_NOTE_UNKNOWN) Not->Type == Tml_NOTE_UNKNOWN)
{ {
Ale_ShowAlert (Ale_ERROR,"Error in note."); Ale_ShowAlert (Ale_ERROR,"Error in note.");
return; return;
@ -267,7 +268,7 @@ static void Tml_Not_WriteTopMessage (Tml_TopMessage_t TopMessage,long PublisherC
Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) Usr_DONT_GET_ROLE_IN_CURRENT_CRS))
{ {
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"Tml_TOP_CONT Tml_TOP_PUBLISHER TL_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_TOP_CONT Tml_TOP_PUBLISHER Tml_WIDTH\"");
/***** Show publisher's name inside form to go to user's public profile *****/ /***** Show publisher's name inside form to go to user's public profile *****/
Tml_Not_WriteAuthorName (&PublisherDat, Tml_Not_WriteAuthorName (&PublisherDat,
@ -321,7 +322,7 @@ void Tml_Not_ShowAuthorPhoto (struct UsrData *UsrDat,bool FormUnique)
{ {
/***** Show author's photo *****/ /***** Show author's photo *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\""); HTM_DIV_Begin ("class=\"Tml_LEFT_PHOTO\"");
/* Photo */ /* Photo */
Pho_ShowUsrPhotoIfAllowed (UsrDat,"PHOTO45x60",Pho_ZOOM,FormUnique); Pho_ShowUsrPhotoIfAllowed (UsrDat,"PHOTO45x60",Pho_ZOOM,FormUnique);
@ -338,11 +339,11 @@ static void Tml_Not_WriteAuthorTimeAndContent (const struct Tml_Not_Note *Not,
const struct UsrData *UsrDat) const struct UsrData *UsrDat)
{ {
/***** Begin top container *****/ /***** Begin top container *****/
HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\"");
/***** Write author's full name *****/ /***** Write author's full name *****/
Tml_Not_WriteAuthorName (UsrDat, Tml_Not_WriteAuthorName (UsrDat,
"BT_LINK TL_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH DAT_N_BOLD"); "BT_LINK Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH DAT_N_BOLD");
/***** Write date and time *****/ /***** Write date and time *****/
Tml_WriteDateTime (Not->DateTimeUTC); Tml_WriteDateTime (Not->DateTimeUTC);
@ -386,7 +387,7 @@ void Tml_Not_WriteAuthorName (const struct UsrData *UsrDat,
static void Tml_Not_WriteContent (const struct Tml_Not_Note *Not) static void Tml_Not_WriteContent (const struct Tml_Not_Note *Not)
{ {
if (Not->Type == TL_NOTE_POST) // It's a post if (Not->Type == Tml_NOTE_POST) // It's a post
Tml_Pst_GetAndWritePost (Not->Cod); Tml_Pst_GetAndWritePost (Not->Cod);
else // Not a post else // Not a post
Tml_Not_GetAndWriteNoPost (Not); Tml_Not_GetAndWriteNoPost (Not);
@ -422,7 +423,7 @@ static void Tml_Not_GetAndWriteNoPost (const struct Tml_Not_Note *Not)
Tml_Not_GetNoteSummary (Not,SummaryStr); Tml_Not_GetNoteSummary (Not,SummaryStr);
/* Write note summary */ /* Write note summary */
HTM_DIV_Begin ("class=\"TL_TXT\""); HTM_DIV_Begin ("class=\"Tml_TXT\"");
HTM_Txt (SummaryStr); HTM_Txt (SummaryStr);
HTM_DIV_End (); HTM_DIV_End ();
} }
@ -446,33 +447,33 @@ static void Tml_Not_GetLocationInHierarchy (const struct Tml_Not_Note *Not,
/***** Get location in hierarchy *****/ /***** Get location in hierarchy *****/
switch (Not->Type) switch (Not->Type)
{ {
case TL_NOTE_INS_DOC_PUB_FILE: case Tml_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE: case Tml_NOTE_INS_SHA_PUB_FILE:
/* Get institution data */ /* Get institution data */
Hie->Ins.InsCod = Not->HieCod; Hie->Ins.InsCod = Not->HieCod;
Ins_GetDataOfInstitByCod (&Hie->Ins); Ins_GetDataOfInstitByCod (&Hie->Ins);
break; break;
case TL_NOTE_CTR_DOC_PUB_FILE: case Tml_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE: case Tml_NOTE_CTR_SHA_PUB_FILE:
/* Get center data */ /* Get center data */
Hie->Ctr.CtrCod = Not->HieCod; Hie->Ctr.CtrCod = Not->HieCod;
Ctr_GetDataOfCenterByCod (&Hie->Ctr); Ctr_GetDataOfCenterByCod (&Hie->Ctr);
break; break;
case TL_NOTE_DEG_DOC_PUB_FILE: case Tml_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE: case Tml_NOTE_DEG_SHA_PUB_FILE:
/* Get degree data */ /* Get degree data */
Hie->Deg.DegCod = Not->HieCod; Hie->Deg.DegCod = Not->HieCod;
Deg_GetDataOfDegreeByCod (&Hie->Deg); Deg_GetDataOfDegreeByCod (&Hie->Deg);
break; break;
case TL_NOTE_CRS_DOC_PUB_FILE: case Tml_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE: case Tml_NOTE_CRS_SHA_PUB_FILE:
case TL_NOTE_CALL_FOR_EXAM: case Tml_NOTE_CALL_FOR_EXAM:
case TL_NOTE_NOTICE: case Tml_NOTE_NOTICE:
/* Get course data */ /* Get course data */
Hie->Crs.CrsCod = Not->HieCod; Hie->Crs.CrsCod = Not->HieCod;
Crs_GetDataOfCourseByCod (&Hie->Crs); Crs_GetDataOfCourseByCod (&Hie->Crs);
break; break;
case TL_NOTE_FORUM_POST: case Tml_NOTE_FORUM_POST:
/* Get forum type of the post */ /* Get forum type of the post */
For_GetForumTypeAndLocationOfAPost (Not->Cod,Forum); For_GetForumTypeAndLocationOfAPost (Not->Cod,Forum);
@ -499,42 +500,42 @@ static void Tml_Not_WriteLocationInHierarchy (const struct Tml_Not_Note *Not,
extern const char *Txt_Forum; extern const char *Txt_Forum;
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"TL_LOC\""); HTM_DIV_Begin ("class=\"Tml_LOC\"");
/***** Write location *****/ /***** Write location *****/
switch (Not->Type) switch (Not->Type)
{ {
case TL_NOTE_INS_DOC_PUB_FILE: case Tml_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE: case Tml_NOTE_INS_SHA_PUB_FILE:
/* Write location (institution) in hierarchy */ /* Write location (institution) in hierarchy */
HTM_TxtF ("%s:&nbsp;%s", HTM_TxtF ("%s:&nbsp;%s",
Txt_Institution, Txt_Institution,
Hie->Ins.ShrtName); Hie->Ins.ShrtName);
break; break;
case TL_NOTE_CTR_DOC_PUB_FILE: case Tml_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE: case Tml_NOTE_CTR_SHA_PUB_FILE:
/* Write location (center) in hierarchy */ /* Write location (center) in hierarchy */
HTM_TxtF ("%s:&nbsp;%s", HTM_TxtF ("%s:&nbsp;%s",
Txt_Center, Txt_Center,
Hie->Ctr.ShrtName); Hie->Ctr.ShrtName);
break; break;
case TL_NOTE_DEG_DOC_PUB_FILE: case Tml_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE: case Tml_NOTE_DEG_SHA_PUB_FILE:
/* Write location (degree) in hierarchy */ /* Write location (degree) in hierarchy */
HTM_TxtF ("%s:&nbsp;%s", HTM_TxtF ("%s:&nbsp;%s",
Txt_Degree, Txt_Degree,
Hie->Deg.ShrtName); Hie->Deg.ShrtName);
break; break;
case TL_NOTE_CRS_DOC_PUB_FILE: case Tml_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE: case Tml_NOTE_CRS_SHA_PUB_FILE:
case TL_NOTE_CALL_FOR_EXAM: case Tml_NOTE_CALL_FOR_EXAM:
case TL_NOTE_NOTICE: case Tml_NOTE_NOTICE:
/* Write location (course) in hierarchy */ /* Write location (course) in hierarchy */
HTM_TxtF ("%s:&nbsp;%s", HTM_TxtF ("%s:&nbsp;%s",
Txt_Course, Txt_Course,
Hie->Crs.ShrtName); Hie->Crs.ShrtName);
break; break;
case TL_NOTE_FORUM_POST: case Tml_NOTE_FORUM_POST:
/* Write forum name */ /* Write forum name */
HTM_TxtF ("%s:&nbsp;%s", HTM_TxtF ("%s:&nbsp;%s",
Txt_Forum, Txt_Forum,
@ -557,58 +558,58 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not,
{ {
extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM]; extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM];
extern const char *The_ClassFormInBoxBold[The_NUM_THEMES]; extern const char *The_ClassFormInBoxBold[The_NUM_THEMES];
extern const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES]; extern const char *Txt_TIMELINE_NOTE[Tml_NOT_NUM_NOTE_TYPES];
extern const char *Txt_not_available; extern const char *Txt_not_available;
char *Anchor = NULL; char *Anchor = NULL;
static const Act_Action_t TL_DefaultActions[TL_NOT_NUM_NOTE_TYPES] = static const Act_Action_t Tml_DefaultActions[Tml_NOT_NUM_NOTE_TYPES] =
{ {
[TL_NOTE_UNKNOWN ] = ActUnk, [Tml_NOTE_UNKNOWN ] = ActUnk,
/* Start tab */ /* Start tab */
[TL_NOTE_POST ] = ActUnk, // action not used [Tml_NOTE_POST ] = ActUnk, // action not used
/* Institution tab */ /* Institution tab */
[TL_NOTE_INS_DOC_PUB_FILE ] = ActReqDatSeeDocIns, [Tml_NOTE_INS_DOC_PUB_FILE ] = ActReqDatSeeDocIns,
[TL_NOTE_INS_SHA_PUB_FILE ] = ActReqDatShaIns, [Tml_NOTE_INS_SHA_PUB_FILE ] = ActReqDatShaIns,
/* Center tab */ /* Center tab */
[TL_NOTE_CTR_DOC_PUB_FILE ] = ActReqDatSeeDocCtr, [Tml_NOTE_CTR_DOC_PUB_FILE ] = ActReqDatSeeDocCtr,
[TL_NOTE_CTR_SHA_PUB_FILE ] = ActReqDatShaCtr, [Tml_NOTE_CTR_SHA_PUB_FILE ] = ActReqDatShaCtr,
/* Degree tab */ /* Degree tab */
[TL_NOTE_DEG_DOC_PUB_FILE ] = ActReqDatSeeDocDeg, [Tml_NOTE_DEG_DOC_PUB_FILE ] = ActReqDatSeeDocDeg,
[TL_NOTE_DEG_SHA_PUB_FILE ] = ActReqDatShaDeg, [Tml_NOTE_DEG_SHA_PUB_FILE ] = ActReqDatShaDeg,
/* Course tab */ /* Course tab */
[TL_NOTE_CRS_DOC_PUB_FILE ] = ActReqDatSeeDocCrs, [Tml_NOTE_CRS_DOC_PUB_FILE ] = ActReqDatSeeDocCrs,
[TL_NOTE_CRS_SHA_PUB_FILE ] = ActReqDatShaCrs, [Tml_NOTE_CRS_SHA_PUB_FILE ] = ActReqDatShaCrs,
/* Assessment tab */ /* Assessment tab */
[TL_NOTE_CALL_FOR_EXAM] = ActSeeOneCfe, [Tml_NOTE_CALL_FOR_EXAM ] = ActSeeOneCfe,
/* Users tab */ /* Users tab */
/* Messages tab */ /* Messages tab */
[TL_NOTE_NOTICE ] = ActSeeOneNot, [Tml_NOTE_NOTICE ] = ActSeeOneNot,
[TL_NOTE_FORUM_POST ] = ActSeeFor, [Tml_NOTE_FORUM_POST ] = ActSeeFor,
/* Analytics tab */ /* Analytics tab */
/* Profile tab */ /* Profile tab */
}; };
static const char *TL_Icons[TL_NOT_NUM_NOTE_TYPES] = static const char *Tml_Icons[Tml_NOT_NUM_NOTE_TYPES] =
{ {
[TL_NOTE_UNKNOWN ] = NULL, [Tml_NOTE_UNKNOWN ] = NULL,
/* Start tab */ /* Start tab */
[TL_NOTE_POST ] = NULL, // icon not used [Tml_NOTE_POST ] = NULL, // icon not used
/* Institution tab */ /* Institution tab */
[TL_NOTE_INS_DOC_PUB_FILE ] = "file.svg", [Tml_NOTE_INS_DOC_PUB_FILE ] = "file.svg",
[TL_NOTE_INS_SHA_PUB_FILE ] = "file.svg", [Tml_NOTE_INS_SHA_PUB_FILE ] = "file.svg",
/* Center tab */ /* Center tab */
[TL_NOTE_CTR_DOC_PUB_FILE ] = "file.svg", [Tml_NOTE_CTR_DOC_PUB_FILE ] = "file.svg",
[TL_NOTE_CTR_SHA_PUB_FILE ] = "file.svg", [Tml_NOTE_CTR_SHA_PUB_FILE ] = "file.svg",
/* Degree tab */ /* Degree tab */
[TL_NOTE_DEG_DOC_PUB_FILE ] = "file.svg", [Tml_NOTE_DEG_DOC_PUB_FILE ] = "file.svg",
[TL_NOTE_DEG_SHA_PUB_FILE ] = "file.svg", [Tml_NOTE_DEG_SHA_PUB_FILE ] = "file.svg",
/* Course tab */ /* Course tab */
[TL_NOTE_CRS_DOC_PUB_FILE ] = "file.svg", [Tml_NOTE_CRS_DOC_PUB_FILE ] = "file.svg",
[TL_NOTE_CRS_SHA_PUB_FILE ] = "file.svg", [Tml_NOTE_CRS_SHA_PUB_FILE ] = "file.svg",
/* Assessment tab */ /* Assessment tab */
[TL_NOTE_CALL_FOR_EXAM] = "bullhorn.svg", [Tml_NOTE_CALL_FOR_EXAM ] = "bullhorn.svg",
/* Users tab */ /* Users tab */
/* Messages tab */ /* Messages tab */
[TL_NOTE_NOTICE ] = "sticky-note.svg", [Tml_NOTE_NOTICE ] = "sticky-note.svg",
[TL_NOTE_FORUM_POST ] = "comments.svg", [Tml_NOTE_FORUM_POST ] = "comments.svg",
/* Analytics tab */ /* Analytics tab */
/* Profile tab */ /* Profile tab */
}; };
@ -618,7 +619,7 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not,
{ {
/***** Do not put form *****/ /***** Do not put form *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_FORM_OFF\""); HTM_DIV_Begin ("class=\"Tml_FORM_OFF\"");
/* Text ("not available") */ /* Text ("not available") */
HTM_Txt (Txt_TIMELINE_NOTE[Not->Type]); HTM_Txt (Txt_TIMELINE_NOTE[Not->Type]);
@ -631,51 +632,51 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not,
else // Not inside another form else // Not inside another form
{ {
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"TL_FORM\""); HTM_DIV_Begin ("class=\"Tml_FORM\"");
/***** Begin form with parameters depending on the type of note *****/ /***** Begin form with parameters depending on the type of note *****/
switch (Not->Type) switch (Not->Type)
{ {
case TL_NOTE_INS_DOC_PUB_FILE: case Tml_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE: case Tml_NOTE_INS_SHA_PUB_FILE:
Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]);
Brw_PutHiddenParamFilCod (Not->Cod); Brw_PutHiddenParamFilCod (Not->Cod);
if (Not->HieCod != Gbl.Hierarchy.Ins.InsCod) // Not the current institution if (Not->HieCod != Gbl.Hierarchy.Ins.InsCod) // Not the current institution
Ins_PutParamInsCod (Not->HieCod); // Go to another institution Ins_PutParamInsCod (Not->HieCod); // Go to another institution
break; break;
case TL_NOTE_CTR_DOC_PUB_FILE: case Tml_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE: case Tml_NOTE_CTR_SHA_PUB_FILE:
Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]);
Brw_PutHiddenParamFilCod (Not->Cod); Brw_PutHiddenParamFilCod (Not->Cod);
if (Not->HieCod != Gbl.Hierarchy.Ctr.CtrCod) // Not the current center if (Not->HieCod != Gbl.Hierarchy.Ctr.CtrCod) // Not the current center
Ctr_PutParamCtrCod (Not->HieCod); // Go to another center Ctr_PutParamCtrCod (Not->HieCod); // Go to another center
break; break;
case TL_NOTE_DEG_DOC_PUB_FILE: case Tml_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE: case Tml_NOTE_DEG_SHA_PUB_FILE:
Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]);
Brw_PutHiddenParamFilCod (Not->Cod); Brw_PutHiddenParamFilCod (Not->Cod);
if (Not->HieCod != Gbl.Hierarchy.Deg.DegCod) // Not the current degree if (Not->HieCod != Gbl.Hierarchy.Deg.DegCod) // Not the current degree
Deg_PutParamDegCod (Not->HieCod); // Go to another degree Deg_PutParamDegCod (Not->HieCod); // Go to another degree
break; break;
case TL_NOTE_CRS_DOC_PUB_FILE: case Tml_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE: case Tml_NOTE_CRS_SHA_PUB_FILE:
Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]);
Brw_PutHiddenParamFilCod (Not->Cod); Brw_PutHiddenParamFilCod (Not->Cod);
if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (Not->HieCod); // Go to another course Crs_PutParamCrsCod (Not->HieCod); // Go to another course
break; break;
case TL_NOTE_CALL_FOR_EXAM: case Tml_NOTE_CALL_FOR_EXAM:
Frm_SetAnchorStr (Not->Cod,&Anchor); Frm_SetAnchorStr (Not->Cod,&Anchor);
Frm_BeginFormUniqueAnchor (TL_DefaultActions[Not->Type], Frm_BeginFormUniqueAnchor (Tml_DefaultActions[Not->Type],
Anchor); // Locate on this specific exam Anchor); // Locate on this specific exam
Frm_FreeAnchorStr (Anchor); Frm_FreeAnchorStr (Anchor);
Cfe_PutHiddenParamExaCod (Not->Cod); Cfe_PutHiddenParamExaCod (Not->Cod);
if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (Not->HieCod); // Go to another course Crs_PutParamCrsCod (Not->HieCod); // Go to another course
break; break;
case TL_NOTE_POST: // Not applicable case Tml_NOTE_POST: // Not applicable
return; return;
case TL_NOTE_FORUM_POST: case Tml_NOTE_FORUM_POST:
Frm_BeginFormUnique (For_ActionsSeeFor[Forums->Forum.Type]); Frm_BeginFormUnique (For_ActionsSeeFor[Forums->Forum.Type]);
For_PutAllHiddenParamsForum (1, // Page of threads = first For_PutAllHiddenParamsForum (1, // Page of threads = first
1, // Page of posts = first 1, // Page of posts = first
@ -687,9 +688,9 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not,
if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (Not->HieCod); // Go to another course Crs_PutParamCrsCod (Not->HieCod); // Go to another course
break; break;
case TL_NOTE_NOTICE: case Tml_NOTE_NOTICE:
Frm_SetAnchorStr (Not->Cod,&Anchor); Frm_SetAnchorStr (Not->Cod,&Anchor);
Frm_BeginFormUniqueAnchor (TL_DefaultActions[Not->Type], Frm_BeginFormUniqueAnchor (Tml_DefaultActions[Not->Type],
Anchor); Anchor);
Frm_FreeAnchorStr (Anchor); Frm_FreeAnchorStr (Anchor);
Not_PutHiddenParamNotCod (Not->Cod); Not_PutHiddenParamNotCod (Not->Cod);
@ -709,7 +710,7 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not,
Str_FreeString (); Str_FreeString ();
/* Icon and text */ /* Icon and text */
Ico_PutIcon (TL_Icons[Not->Type], Ico_PutIcon (Tml_Icons[Not->Type],
Txt_TIMELINE_NOTE[Not->Type],"CONTEXT_ICO_x16"); Txt_TIMELINE_NOTE[Not->Type],"CONTEXT_ICO_x16");
HTM_TxtF ("&nbsp;%s",Txt_TIMELINE_NOTE[Not->Type]); HTM_TxtF ("&nbsp;%s",Txt_TIMELINE_NOTE[Not->Type]);
@ -735,28 +736,28 @@ void Tml_Not_GetNoteSummary (const struct Tml_Not_Note *Not,
switch (Not->Type) switch (Not->Type)
{ {
case TL_NOTE_UNKNOWN: case Tml_NOTE_UNKNOWN:
break; break;
case TL_NOTE_INS_DOC_PUB_FILE: case Tml_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE: case Tml_NOTE_INS_SHA_PUB_FILE:
case TL_NOTE_CTR_DOC_PUB_FILE: case Tml_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE: case Tml_NOTE_CTR_SHA_PUB_FILE:
case TL_NOTE_DEG_DOC_PUB_FILE: case Tml_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE: case Tml_NOTE_DEG_SHA_PUB_FILE:
case TL_NOTE_CRS_DOC_PUB_FILE: case Tml_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE: case Tml_NOTE_CRS_SHA_PUB_FILE:
Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,Not->Cod,false); Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,Not->Cod,false);
break; break;
case TL_NOTE_CALL_FOR_EXAM: case Tml_NOTE_CALL_FOR_EXAM:
Cfe_GetSummaryAndContentCallForExam (SummaryStr,NULL,Not->Cod,false); Cfe_GetSummaryAndContentCallForExam (SummaryStr,NULL,Not->Cod,false);
break; break;
case TL_NOTE_POST: case Tml_NOTE_POST:
// Not applicable // Not applicable
break; break;
case TL_NOTE_FORUM_POST: case Tml_NOTE_FORUM_POST:
For_GetSummaryAndContentForumPst (SummaryStr,NULL,Not->Cod,false); For_GetSummaryAndContentForumPst (SummaryStr,NULL,Not->Cod,false);
break; break;
case TL_NOTE_NOTICE: case Tml_NOTE_NOTICE:
Not_GetSummaryAndContentNotice (SummaryStr,NULL,Not->Cod,false); Not_GetSummaryAndContentNotice (SummaryStr,NULL,Not->Cod,false);
break; break;
} }
@ -793,7 +794,7 @@ static void Tml_Not_WriteButtonToAddAComm (const struct Tml_Not_Note *Not,
const char IdNewComm[Frm_MAX_BYTES_ID + 1]) const char IdNewComm[Frm_MAX_BYTES_ID + 1])
{ {
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"TL_BOTTOM_LEFT\""); HTM_DIV_Begin ("class=\"Tml_BOTTOM_LEFT\"");
/***** Button to add a comment *****/ /***** Button to add a comment *****/
if (Not->Unavailable) // Unavailable notes can not be commented if (Not->Unavailable) // Unavailable notes can not be commented
@ -814,7 +815,7 @@ static void Tml_Not_WriteFavShaRemAndComms (const struct Tml_Timeline *Timeline,
const struct UsrData *UsrDat) // Author const struct UsrData *UsrDat) // Author
{ {
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"TL_BOTTOM_RIGHT TL_RIGHT_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_BOTTOM_RIGHT Tml_RIGHT_WIDTH\"");
/***** Write favs, shared and remove buttons int the foot of a note *****/ /***** Write favs, shared and remove buttons int the foot of a note *****/
Tml_Not_WriteFavShaRem (Timeline,Not,UsrDat); Tml_Not_WriteFavShaRem (Timeline,Not,UsrDat);
@ -839,11 +840,11 @@ static void Tml_Not_WriteFavShaRem (const struct Tml_Timeline *Timeline,
NumDiv++; NumDiv++;
/***** Begin foot container *****/ /***** Begin foot container *****/
HTM_DIV_Begin ("class=\"TL_FOOT TL_RIGHT_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_FOOT Tml_RIGHT_WIDTH\"");
/***** Foot column 1: fav zone *****/ /***** Foot column 1: fav zone *****/
HTM_DIV_Begin ("id=\"fav_not_%s_%u\"" HTM_DIV_Begin ("id=\"fav_not_%s_%u\""
" class=\"TL_FAV_NOT TL_FAV_NOT_WIDTH\"", " class=\"Tml_FAV_NOT Tml_FAV_NOT_WIDTH\"",
Gbl.UniqueNameEncrypted,NumDiv); Gbl.UniqueNameEncrypted,NumDiv);
Tml_Usr_PutIconFavSha (Tml_Usr_FAV_UNF_NOTE, Tml_Usr_PutIconFavSha (Tml_Usr_FAV_UNF_NOTE,
Not->NotCod,Not->UsrCod,Not->NumFavs, Not->NotCod,Not->UsrCod,Not->NumFavs,
@ -852,7 +853,7 @@ static void Tml_Not_WriteFavShaRem (const struct Tml_Timeline *Timeline,
/***** Foot column 2: share zone *****/ /***** Foot column 2: share zone *****/
HTM_DIV_Begin ("id=\"sha_not_%s_%u\"" HTM_DIV_Begin ("id=\"sha_not_%s_%u\""
" class=\"TL_SHA_NOT TL_SHA_NOT_WIDTH\"", " class=\"Tml_SHA_NOT Tml_SHA_NOT_WIDTH\"",
Gbl.UniqueNameEncrypted,NumDiv); Gbl.UniqueNameEncrypted,NumDiv);
Tml_Usr_PutIconFavSha (Tml_Usr_SHA_UNS_NOTE, Tml_Usr_PutIconFavSha (Tml_Usr_SHA_UNS_NOTE,
Not->NotCod,Not->UsrCod,Not->NumShared, Not->NotCod,Not->UsrCod,Not->NumShared,
@ -860,7 +861,7 @@ static void Tml_Not_WriteFavShaRem (const struct Tml_Timeline *Timeline,
HTM_DIV_End (); HTM_DIV_End ();
/***** Foot column 3: icon to remove this note *****/ /***** Foot column 3: icon to remove this note *****/
HTM_DIV_Begin ("class=\"TL_REM\""); HTM_DIV_Begin ("class=\"Tml_REM\"");
if (Usr_ItsMe (UsrDat->UsrCod)) // I am the author if (Usr_ItsMe (UsrDat->UsrCod)) // I am the author
Tml_Not_PutFormToRemoveNote (Timeline,Not->NotCod); Tml_Not_PutFormToRemoveNote (Timeline,Not->NotCod);
HTM_DIV_End (); HTM_DIV_End ();
@ -908,22 +909,22 @@ void Tml_Not_StoreAndPublishNoteInternal (Tml_Not_Type_t NoteType,long Cod,
switch (NoteType) switch (NoteType)
{ {
case TL_NOTE_INS_DOC_PUB_FILE: case Tml_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE: case Tml_NOTE_INS_SHA_PUB_FILE:
HieCod = Gbl.Hierarchy.Ins.InsCod; HieCod = Gbl.Hierarchy.Ins.InsCod;
break; break;
case TL_NOTE_CTR_DOC_PUB_FILE: case Tml_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE: case Tml_NOTE_CTR_SHA_PUB_FILE:
HieCod = Gbl.Hierarchy.Ctr.CtrCod; HieCod = Gbl.Hierarchy.Ctr.CtrCod;
break; break;
case TL_NOTE_DEG_DOC_PUB_FILE: case Tml_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE: case Tml_NOTE_DEG_SHA_PUB_FILE:
HieCod = Gbl.Hierarchy.Deg.DegCod; HieCod = Gbl.Hierarchy.Deg.DegCod;
break; break;
case TL_NOTE_CRS_DOC_PUB_FILE: case Tml_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE: case Tml_NOTE_CRS_SHA_PUB_FILE:
case TL_NOTE_CALL_FOR_EXAM: case Tml_NOTE_CALL_FOR_EXAM:
case TL_NOTE_NOTICE: case Tml_NOTE_NOTICE:
HieCod = Gbl.Hierarchy.Crs.CrsCod; HieCod = Gbl.Hierarchy.Crs.CrsCod;
break; break;
default: default:
@ -934,7 +935,7 @@ void Tml_Not_StoreAndPublishNoteInternal (Tml_Not_Type_t NoteType,long Cod,
/***** Publish note in timeline *****/ /***** Publish note in timeline *****/
Pub->PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; Pub->PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod;
Pub->NotCod = Tml_DB_CreateNewNote (NoteType,Cod,Pub->PublisherCod,HieCod); Pub->NotCod = Tml_DB_CreateNewNote (NoteType,Cod,Pub->PublisherCod,HieCod);
Pub->Type = Tml_Pub_ORIGINAL_NOTE; Pub->Type = Tml_Pub_ORIGINAL_NOTE;
Tml_Pub_PublishPubInTimeline (Pub); Tml_Pub_PublishPubInTimeline (Pub);
} }
@ -949,13 +950,11 @@ void Tml_Not_MarkNoteOneFileAsUnavailable (const char *Path)
long FilCod; long FilCod;
if (Tml_Not_NoteType[FileBrowser]) if (Tml_Not_NoteType[FileBrowser])
{
/***** Get file code *****/ /***** Get file code *****/
FilCod = Brw_DB_GetFilCodByPath (Path,true); // Only if file is public if ((FilCod = Brw_DB_GetFilCodByPath (Path,
if (FilCod > 0) true)) > 0) // Only public files
/***** Mark possible note as unavailable *****/ /***** Mark possible note as unavailable *****/
Tml_DB_MarkNoteAsUnavailable (Tml_Not_NoteType[FileBrowser],FilCod); Tml_DB_MarkNoteAsUnavailable (Tml_Not_NoteType[FileBrowser],FilCod);
}
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1010,7 +1009,7 @@ void Tml_Not_RequestRemNoteUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Request the removal of note *****/ /***** Request the removal of note *****/
Tml_Not_RequestRemovalNote (&Timeline); Tml_Not_RequestRemovalNote (&Timeline);
@ -1057,7 +1056,7 @@ static void Tml_Not_RequestRemovalNote (struct Tml_Timeline *Timeline)
Box_BoxBegin (NULL,NULL, Box_BoxBegin (NULL,NULL,
NULL,NULL, NULL,NULL,
NULL,Box_CLOSABLE); NULL,Box_CLOSABLE);
HTM_DIV_Begin ("class=\"TL_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_WIDTH\"");
Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not, Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not,
Tml_TOP_MESSAGE_NONE, Tml_TOP_MESSAGE_NONE,
-1L); -1L);
@ -1104,7 +1103,7 @@ void Tml_Not_RemoveNoteUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Remove a note *****/ /***** Remove a note *****/
Tml_Not_RemoveNote (); Tml_Not_RemoveNote ();
@ -1197,7 +1196,7 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not)
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
/***** Remove media associated to post *****/ /***** Remove media associated to post *****/
if (Not->Type == TL_NOTE_POST) if (Not->Type == Tml_NOTE_POST)
if ((MedCod = Tml_DB_GetMedCodFromPost (Not->Cod)) > 0) if ((MedCod = Tml_DB_GetMedCodFromPost (Not->Cod)) > 0)
Med_RemoveMedia (MedCod); Med_RemoveMedia (MedCod);
@ -1206,9 +1205,9 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not)
PubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); PubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (PubCod > 0) if (PubCod > 0)
{ {
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV ,PubCod);
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE ,PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_SHARE ,PubCod);
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_MENTION,PubCod);
} }
/***** Remove favs for this note *****/ /***** Remove favs for this note *****/
@ -1220,7 +1219,7 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not)
/***** Remove note *****/ /***** Remove note *****/
Tml_DB_RemoveNote (Not->NotCod); Tml_DB_RemoveNote (Not->NotCod);
if (Not->Type == TL_NOTE_POST) if (Not->Type == Tml_NOTE_POST)
/***** Remove post *****/ /***** Remove post *****/
Tml_DB_RemovePost (Not->Cod); Tml_DB_RemovePost (Not->Cod);
} }
@ -1244,15 +1243,13 @@ static void Tml_Not_GetDataOfNoteFromRow (MYSQL_ROW row,struct Tml_Not_Note *Not
Not->NotCod = Str_ConvertStrCodToLongCod (row[0]); Not->NotCod = Str_ConvertStrCodToLongCod (row[0]);
/***** Get note type (row[1]) *****/ /***** Get note type (row[1]) *****/
Not->Type = Tml_Not_GetNoteTypeFromStr (row[1]); Not->Type = Tml_Not_GetNoteTypeFromStr (row[1]);
/***** Get file/post... code (row[2]) *****/ /***** Get file/post... code (row[2]),
(from) user code (row[3])
and hierarchy code (row[4]) *****/
Not->Cod = Str_ConvertStrCodToLongCod (row[2]); Not->Cod = Str_ConvertStrCodToLongCod (row[2]);
/***** Get (from) user code (row[3]) *****/
Not->UsrCod = Str_ConvertStrCodToLongCod (row[3]); Not->UsrCod = Str_ConvertStrCodToLongCod (row[3]);
/***** Get hierarchy code (row[4]) *****/
Not->HieCod = Str_ConvertStrCodToLongCod (row[4]); Not->HieCod = Str_ConvertStrCodToLongCod (row[4]);
/***** File/post... unavailable (row[5]) *****/ /***** File/post... unavailable (row[5]) *****/
@ -1261,10 +1258,8 @@ static void Tml_Not_GetDataOfNoteFromRow (MYSQL_ROW row,struct Tml_Not_Note *Not
/***** Get time of the note (row[6]) *****/ /***** Get time of the note (row[6]) *****/
Not->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[6]); Not->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[6]);
/***** Get number of times this note has been shared *****/ /***** Get number of times this note has been shared and favourited *****/
Not->NumShared = Tml_DB_GetNumSharers (Not->NotCod,Not->UsrCod); Not->NumShared = Tml_DB_GetNumSharers (Not->NotCod,Not->UsrCod);
/***** Get number of times this note has been favourited *****/
Not->NumFavs = Tml_DB_GetNumFavers (Tml_Usr_FAV_UNF_NOTE, Not->NumFavs = Tml_DB_GetNumFavers (Tml_Usr_FAV_UNF_NOTE,
Not->NotCod,Not->UsrCod); Not->NotCod,Not->UsrCod);
} }
@ -1278,10 +1273,10 @@ static Tml_Not_Type_t Tml_Not_GetNoteTypeFromStr (const char *Str)
unsigned UnsignedNum; unsigned UnsignedNum;
if (sscanf (Str,"%u",&UnsignedNum) == 1) if (sscanf (Str,"%u",&UnsignedNum) == 1)
if (UnsignedNum < TL_NOT_NUM_NOTE_TYPES) if (UnsignedNum < Tml_NOT_NUM_NOTE_TYPES)
return (Tml_Not_Type_t) UnsignedNum; return (Tml_Not_Type_t) UnsignedNum;
return TL_NOTE_UNKNOWN; return Tml_NOTE_UNKNOWN;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1291,7 +1286,7 @@ static Tml_Not_Type_t Tml_Not_GetNoteTypeFromStr (const char *Str)
static void Tml_Not_ResetNote (struct Tml_Not_Note *Not) static void Tml_Not_ResetNote (struct Tml_Not_Note *Not)
{ {
Not->NotCod = -1L; Not->NotCod = -1L;
Not->Type = TL_NOTE_UNKNOWN; Not->Type = Tml_NOTE_UNKNOWN;
Not->UsrCod = -1L; Not->UsrCod = -1L;
Not->HieCod = -1L; Not->HieCod = -1L;
Not->Cod = -1L; Not->Cod = -1L;

View File

@ -33,32 +33,32 @@
/******************************** Public types *******************************/ /******************************** Public types *******************************/
/*****************************************************************************/ /*****************************************************************************/
#define TL_NOT_NUM_NOTE_TYPES 13 #define Tml_NOT_NUM_NOTE_TYPES 13
// If the numbers assigned to each event type change, // If the numbers assigned to each event type change,
// it is necessary to change old numbers to new ones in database table tml_notes // it is necessary to change old numbers to new ones in database table tml_notes
typedef enum typedef enum
{ {
TL_NOTE_UNKNOWN = 0, Tml_NOTE_UNKNOWN = 0,
/* Start tab */ /* Start tab */
TL_NOTE_POST = 10, // Post written directly in timeline Tml_NOTE_POST = 10, // Post written directly in timeline
/* Institution tab */ /* Institution tab */
TL_NOTE_INS_DOC_PUB_FILE = 1, // Public file in documents of institution Tml_NOTE_INS_DOC_PUB_FILE = 1, // Public file in documents of institution
TL_NOTE_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution Tml_NOTE_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution
/* Center tab */ /* Center tab */
TL_NOTE_CTR_DOC_PUB_FILE = 3, // Public file in documents of center Tml_NOTE_CTR_DOC_PUB_FILE = 3, // Public file in documents of center
TL_NOTE_CTR_SHA_PUB_FILE = 4, // Public file in shared files of center Tml_NOTE_CTR_SHA_PUB_FILE = 4, // Public file in shared files of center
/* Degree tab */ /* Degree tab */
TL_NOTE_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree Tml_NOTE_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree
TL_NOTE_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree Tml_NOTE_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree
/* Course tab */ /* Course tab */
TL_NOTE_CRS_DOC_PUB_FILE = 7, // Public file in documents of course Tml_NOTE_CRS_DOC_PUB_FILE = 7, // Public file in documents of course
TL_NOTE_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course Tml_NOTE_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course
/* Assessment tab */ /* Assessment tab */
TL_NOTE_CALL_FOR_EXAM = 9, // Exam announcement in a course Tml_NOTE_CALL_FOR_EXAM = 9, // Call for exam in a course
/* Users tab */ /* Users tab */
/* Messages tab */ /* Messages tab */
TL_NOTE_NOTICE = 12, // A public notice in a course Tml_NOTE_NOTICE = 12, // A public notice in a course
TL_NOTE_FORUM_POST = 11, // Post in global/swad forums Tml_NOTE_FORUM_POST = 11, // Post in global/swad forums
/* Analytics tab */ /* Analytics tab */
/* Profile tab */ /* Profile tab */
} Tml_Not_Type_t; } Tml_Not_Type_t;

View File

@ -124,7 +124,7 @@ void Tml_Ntf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
Not.NotCod = Pub.NotCod; Not.NotCod = Pub.NotCod;
Tml_Not_GetDataOfNoteByCod (&Not); Tml_Not_GetDataOfNoteByCod (&Not);
if (Not.Type == TL_NOTE_POST) if (Not.Type == Tml_NOTE_POST)
{ {
/***** Get post from database *****/ /***** Get post from database *****/
if (Tml_DB_GetPostByCod (Not.Cod,&mysql_res) == 1) // Result should have a unique row if (Tml_DB_GetPostByCod (Not.Cod,&mysql_res) == 1) // Result should have a unique row
@ -201,8 +201,8 @@ void Tml_Ntf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
void Tml_Ntf_MarkMyNotifAsSeen (void) void Tml_Ntf_MarkMyNotifAsSeen (void)
{ {
Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_COMMENT); Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_COMMENT);
Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_FAV ); Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_FAV );
Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_SHARE ); Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_SHARE );
Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_MENTION); Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_MENTION);
} }

View File

@ -124,14 +124,14 @@ static void Tml_Pst_ShowPostContent (struct Tml_Pst_Content *Content)
/***** Write content text *****/ /***** Write content text *****/
if (Content->Txt[0]) if (Content->Txt[0])
{ {
HTM_DIV_Begin ("class=\"TL_TXT\""); HTM_DIV_Begin ("class=\"Tml_TXT\"");
Msg_WriteMsgContent (Content->Txt,Cns_MAX_BYTES_LONG_TEXT,true,false); Msg_WriteMsgContent (Content->Txt,Cns_MAX_BYTES_LONG_TEXT,true,false);
HTM_DIV_End (); HTM_DIV_End ();
} }
/***** Show media *****/ /***** Show media *****/
Med_ShowMedia (&Content->Media,"TL_PST_MED_CONT TL_RIGHT_WIDTH", Med_ShowMedia (&Content->Media,"Tml_PST_MED_CONT Tml_RIGHT_WIDTH",
"TL_PST_MED TL_RIGHT_WIDTH"); "Tml_PST_MED Tml_RIGHT_WIDTH");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -141,10 +141,10 @@ static void Tml_Pst_ShowPostContent (struct Tml_Pst_Content *Content)
void Tml_Pst_PutPhotoAndFormToWriteNewPost (struct Tml_Timeline *Timeline) void Tml_Pst_PutPhotoAndFormToWriteNewPost (struct Tml_Timeline *Timeline)
{ {
/***** Begin list *****/ /***** Begin list *****/
HTM_UL_Begin ("class=\"TL_LIST\""); HTM_UL_Begin ("class=\"Tml_LIST\"");
/***** Begin list item *****/ /***** Begin list item *****/
HTM_LI_Begin ("class=\"TL_WIDTH\""); HTM_LI_Begin ("class=\"Tml_WIDTH\"");
/***** Left: write author's photo (my photo) *****/ /***** Left: write author's photo (my photo) *****/
Tml_Not_ShowAuthorPhoto (&Gbl.Usrs.Me.UsrDat,false); // Don't use unique id Tml_Not_ShowAuthorPhoto (&Gbl.Usrs.Me.UsrDat,false); // Don't use unique id
@ -168,20 +168,20 @@ static void Tml_Pst_PutFormToWriteNewPost (struct Tml_Timeline *Timeline)
extern const char *Txt_New_TIMELINE_post; extern const char *Txt_New_TIMELINE_post;
/***** Begin container *****/ /***** Begin container *****/
HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\"");
/***** Author name *****/ /***** Author name *****/
Tml_Not_WriteAuthorName (&Gbl.Usrs.Me.UsrDat, Tml_Not_WriteAuthorName (&Gbl.Usrs.Me.UsrDat,
"BT_LINK TL_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH DAT_N_BOLD"); "BT_LINK Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH DAT_N_BOLD");
/***** Form to write the post *****/ /***** Form to write the post *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_FORM_NEW_PST TL_RIGHT_WIDTH\""); HTM_DIV_Begin ("class=\"Tml_FORM_NEW_PST Tml_RIGHT_WIDTH\"");
/* Form with textarea */ /* Form with textarea */
Tml_Frm_BeginForm (Timeline,Tml_Frm_RECEIVE_POST); Tml_Frm_BeginForm (Timeline,Tml_Frm_RECEIVE_POST);
Tml_Pst_PutTextarea (Txt_New_TIMELINE_post, Tml_Pst_PutTextarea (Txt_New_TIMELINE_post,
"TL_PST_TEXTAREA TL_RIGHT_WIDTH"); "Tml_PST_TEXTAREA Tml_RIGHT_WIDTH");
Tml_Frm_EndForm (); Tml_Frm_EndForm ();
/* End container */ /* End container */
@ -219,7 +219,7 @@ void Tml_Pst_PutTextarea (const char *Placeholder,const char *ClassTextArea)
Lay_HelpPlainEditor (); Lay_HelpPlainEditor ();
/***** Attached image (optional) *****/ /***** Attached image (optional) *****/
Med_PutMediaUploader (-1,"TL_MED_INPUT_WIDTH"); Med_PutMediaUploader (-1,"Tml_MED_INPUT_WIDTH");
/***** Submit button *****/ /***** Submit button *****/
HTM_BUTTON_SUBMIT_Begin (NULL,"BT_SUBMIT_INLINE BT_CREATE",NULL); HTM_BUTTON_SUBMIT_Begin (NULL,"BT_SUBMIT_INLINE BT_CREATE",NULL);
@ -249,7 +249,7 @@ void Tml_Pst_ReceivePostUsr (void)
Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat);
/***** Begin section *****/ /***** Begin section *****/
HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID);
/***** Receive and store post, and /***** Receive and store post, and
write updated timeline after publication (user) *****/ write updated timeline after publication (user) *****/
@ -307,7 +307,7 @@ static long Tml_Pst_ReceivePost (void)
PstCod = Tml_DB_CreateNewPost (&Content); PstCod = Tml_DB_CreateNewPost (&Content);
/* Insert post in notes */ /* Insert post in notes */
Tml_Not_StoreAndPublishNoteInternal (TL_NOTE_POST,PstCod,&Pub); Tml_Not_StoreAndPublishNoteInternal (Tml_NOTE_POST,PstCod,&Pub);
/***** Analyze content and store notifications about mentions *****/ /***** Analyze content and store notifications about mentions *****/
Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt);

View File

@ -353,7 +353,7 @@ void Tml_Pub_InsertNewPubsInTimeline (struct Tml_Timeline *Timeline)
Tml_Not_GetDataOfNoteByCod (&Not); Tml_Not_GetDataOfNoteByCod (&Not);
/* Write note */ /* Write note */
HTM_LI_Begin ("class=\"TL_WIDTH TL_SEP TL_NEW_PUB\"" HTM_LI_Begin ("class=\"Tml_WIDTH Tml_SEP Tml_NEW_PUB\""
" data-note-code=\"%ld\"", // Note code to be read later... " data-note-code=\"%ld\"", // Note code to be read later...
Not.NotCod); // ...from JavaScript... Not.NotCod); // ...from JavaScript...
// ...to avoid repeating notes // ...to avoid repeating notes
@ -384,7 +384,7 @@ void Tml_Pub_ShowOldPubsInTimeline (struct Tml_Timeline *Timeline)
Tml_Not_GetDataOfNoteByCod (&Not); Tml_Not_GetDataOfNoteByCod (&Not);
/* Write note */ /* Write note */
HTM_LI_Begin ("class=\"TL_WIDTH TL_SEP\""); HTM_LI_Begin ("class=\"Tml_WIDTH Tml_SEP\"");
Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not, Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not,
Tml_Pub_GetTopMessage (Pub->Type), Tml_Pub_GetTopMessage (Pub->Type),
Pub->PublisherCod); Pub->PublisherCod);
@ -422,7 +422,7 @@ void Tml_Pub_PutLinkToViewNewPubs (void)
/* Begin container */ /* Begin container */
// div is hidden. When new posts arrive to the client via AJAX, div is shown // div is hidden. When new posts arrive to the client via AJAX, div is shown
HTM_DIV_Begin ("id=\"view_new_posts_container\"" HTM_DIV_Begin ("id=\"view_new_posts_container\""
" class=\"TL_WIDTH TL_SEP VERY_LIGHT_BLUE\"" " class=\"Tml_WIDTH Tml_SEP VERY_LIGHT_BLUE\""
" style=\"display:none;\""); " style=\"display:none;\"");
/* Begin anchor */ /* Begin anchor */
@ -456,7 +456,7 @@ void Tml_Pub_PutLinkToViewOldPubs (void)
/***** Animated link to view old publications *****/ /***** Animated link to view old publications *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("id=\"view_old_posts_container\"" HTM_DIV_Begin ("id=\"view_old_posts_container\""
" class=\"TL_WIDTH TL_SEP VERY_LIGHT_BLUE\""); " class=\"Tml_WIDTH Tml_SEP VERY_LIGHT_BLUE\"");
/* Begin anchor */ /* Begin anchor */
HTM_A_Begin ("href=\"\" class=\"%s\" onclick=\"" HTM_A_Begin ("href=\"\" class=\"%s\" onclick=\""
@ -497,7 +497,6 @@ void Tml_Pub_PutHiddenParamPubCod (long PubCod)
long Tml_Pub_GetParamPubCod (void) long Tml_Pub_GetParamPubCod (void)
{ {
/***** Get comment code *****/
return Par_GetParToLong ("PubCod"); return Par_GetParToLong ("PubCod");
} }
@ -523,7 +522,7 @@ void Tml_Pub_GetDataOfPubFromNextRow (MYSQL_RES *mysql_res,
Pub->PubCod = Str_ConvertStrCodToLongCod (row[0]); Pub->PubCod = Str_ConvertStrCodToLongCod (row[0]);
Pub->NotCod = Str_ConvertStrCodToLongCod (row[1]); Pub->NotCod = Str_ConvertStrCodToLongCod (row[1]);
Pub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]); Pub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]);
Pub->Type = Tml_Pub_GetPubTypeFromStr (row[3]); Pub->Type = Tml_Pub_GetPubTypeFromStr (row[3]);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -131,7 +131,7 @@ static void Tml_Sha_ShaNote (struct Tml_Not_Note *Not)
for the author of the post *****/ for the author of the post *****/
OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0) if (OriginalPubCod > 0)
Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_SHARE); Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TML_SHARE);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -181,5 +181,5 @@ static void Tml_Sha_UnsNote (struct Tml_Not_Note *Not)
/***** Mark possible notifications on this note as removed *****/ /***** Mark possible notifications on this note as removed *****/
OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0) if (OriginalPubCod > 0)
Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE,OriginalPubCod); Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_SHARE,OriginalPubCod);
} }

View File

@ -151,7 +151,7 @@ static void Tml_Usr_GetAndShowSharersOrFavers (Tml_Usr_FavSha_t FavSha,
HTM_DIV_End (); HTM_DIV_End ();
/* List users one by one */ /* List users one by one */
HTM_DIV_Begin ("class=\"TL_USRS\""); HTM_DIV_Begin ("class=\"Tml_USRS\"");
Tml_Usr_ListSharersOrFavers (&mysql_res,NumUsrs,NumFirstUsrs); Tml_Usr_ListSharersOrFavers (&mysql_res,NumUsrs,NumFirstUsrs);
if (NumFirstUsrs < NumUsrs) // Not all are shown if (NumFirstUsrs < NumUsrs) // Not all are shown
/* Clickable ellipsis to show all users */ /* Clickable ellipsis to show all users */
@ -207,7 +207,7 @@ static void Tml_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res,
Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) Usr_DONT_GET_ROLE_IN_CURRENT_CRS))
{ {
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_SHARER\""); HTM_DIV_Begin ("class=\"Tml_SHARER\"");
/* User's photo */ /* User's photo */
Pho_ShowUsrPhotoIfAllowed (&UsrDat,"PHOTO12x16",Pho_ZOOM,true); // Use unique id Pho_ShowUsrPhotoIfAllowed (&UsrDat,"PHOTO12x16",Pho_ZOOM,true); // Use unique id
@ -273,7 +273,7 @@ void Tml_Usr_PutIconFavSha (Tml_Usr_FavSha_t FavSha,
{ {
/***** Put form to fav/unfav or share/unshare this note/comment *****/ /***** Put form to fav/unfav or share/unshare this note/comment *****/
/* Begin container */ /* Begin container */
HTM_DIV_Begin ("class=\"TL_ICO\""); HTM_DIV_Begin ("class=\"Tml_ICO\"");
/* Icon to fav/unfav or share/unshare this note/comment */ /* Icon to fav/unfav or share/unshare this note/comment */
if (Usr_ItsMe (UsrCod)) // I am the author ==> I can not fav/unfav or share/unshare if (Usr_ItsMe (UsrCod)) // I am the author ==> I can not fav/unfav or share/unshare
@ -299,34 +299,55 @@ static void Tml_Usr_PutDisabledIconFavSha (Tml_Usr_FavSha_t FavSha,
extern const char *Txt_TIMELINE_Not_favourited_by_anyone; extern const char *Txt_TIMELINE_Not_favourited_by_anyone;
extern const char *Txt_TIMELINE_Shared_by_X_USERS; extern const char *Txt_TIMELINE_Shared_by_X_USERS;
extern const char *Txt_TIMELINE_Not_shared_by_anyone; extern const char *Txt_TIMELINE_Not_shared_by_anyone;
static const char *Icon[Tml_Usr_NUM_FAV_SHA] = static const struct
{ {
[Tml_Usr_FAV_UNF_NOTE] = Tml_Fav_ICON_FAV, const char *Icon;
[Tml_Usr_FAV_UNF_COMM] = Tml_Fav_ICON_FAV, struct
[Tml_Usr_SHA_UNS_NOTE] = Tml_Sha_ICON_SHARE, {
}; const char **WithUsrs;
static const char **TitleWithUsrs[Tml_Usr_NUM_FAV_SHA] = const char **WithoutUsrs;
} Title;
} Ico[Tml_Usr_NUM_FAV_SHA] =
{ {
[Tml_Usr_FAV_UNF_NOTE] = &Txt_TIMELINE_Favourited_by_X_USERS, [Tml_Usr_FAV_UNF_NOTE] =
[Tml_Usr_FAV_UNF_COMM] = &Txt_TIMELINE_Favourited_by_X_USERS, {
[Tml_Usr_SHA_UNS_NOTE] = &Txt_TIMELINE_Shared_by_X_USERS, .Icon = Tml_Fav_ICON_FAV,
}; .Title =
static const char **TitleWithoutUsrs[Tml_Usr_NUM_FAV_SHA] = {
{ .WithUsrs = &Txt_TIMELINE_Favourited_by_X_USERS,
[Tml_Usr_FAV_UNF_NOTE] = &Txt_TIMELINE_Not_favourited_by_anyone, .WithoutUsrs = &Txt_TIMELINE_Not_favourited_by_anyone,
[Tml_Usr_FAV_UNF_COMM] = &Txt_TIMELINE_Not_favourited_by_anyone, },
[Tml_Usr_SHA_UNS_NOTE] = &Txt_TIMELINE_Not_shared_by_anyone, },
[Tml_Usr_FAV_UNF_COMM] =
{
.Icon = Tml_Fav_ICON_FAV,
.Title =
{
.WithUsrs = &Txt_TIMELINE_Favourited_by_X_USERS,
.WithoutUsrs = &Txt_TIMELINE_Not_favourited_by_anyone,
},
},
[Tml_Usr_SHA_UNS_NOTE] =
{
.Icon = Tml_Sha_ICON_SHARE,
.Title =
{
.WithUsrs = &Txt_TIMELINE_Shared_by_X_USERS,
.WithoutUsrs = &Txt_TIMELINE_Not_shared_by_anyone,
},
},
}; };
/***** Disabled icon to fav/share *****/ /***** Disabled icon to fav/share *****/
if (NumUsrs) if (NumUsrs)
{ {
Ico_PutDivIcon ("TL_ICO_DISABLED",Icon[FavSha], Ico_PutDivIcon ("Tml_ICO_DISABLED",Ico[FavSha].Icon,
Str_BuildStringLong (*TitleWithUsrs[FavSha],(long) NumUsrs)); Str_BuildStringLong (*Ico[FavSha].Title.WithUsrs,(long) NumUsrs));
Str_FreeString (); Str_FreeString ();
} }
else else
Ico_PutDivIcon ("TL_ICO_DISABLED",Icon[FavSha],*TitleWithoutUsrs[FavSha]); Ico_PutDivIcon ("Tml_ICO_DISABLED",Ico[FavSha].Icon,
*Ico[FavSha].Title.WithoutUsrs);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -44,7 +44,7 @@ extern struct Globals Gbl;
/************************* Private global variables **************************/ /************************* Private global variables **************************/
/*****************************************************************************/ /*****************************************************************************/
Usr_Who_t TL_GlobalWho; Usr_Who_t Tml_GlobalWho;
/*****************************************************************************/ /*****************************************************************************/
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
@ -175,12 +175,12 @@ void Tml_Who_SaveWhoInDB (struct Tml_Timeline *Timeline)
static void Tml_Who_SetGlobalWho (Usr_Who_t Who) static void Tml_Who_SetGlobalWho (Usr_Who_t Who)
{ {
TL_GlobalWho = Who; Tml_GlobalWho = Who;
} }
Usr_Who_t Tml_Who_GetGlobalWho (void) Usr_Who_t Tml_Who_GetGlobalWho (void)
{ {
return TL_GlobalWho; return Tml_GlobalWho;
} }
/*****************************************************************************/ /*****************************************************************************/