mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-09 10:15:24 +02:00
Version 20.33.11: Feb 23, 2021 Code refactoring in timeline.
This commit is contained in:
parent
321faa3489
commit
bb14ad098c
|
@ -553,7 +553,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.33.10 (2021-02-23)"
|
#define Log_PLATFORM_VERSION "SWAD 20.33.11 (2021-02-23)"
|
||||||
#define CSS_FILE "swad20.33.9.css"
|
#define CSS_FILE "swad20.33.9.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.js"
|
||||||
/*
|
/*
|
||||||
|
@ -601,6 +601,7 @@ TODO: DNI de un estudiante sale err
|
||||||
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
|
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
|
||||||
TODO: Salvador Romero Cortés: @acanas opción para editar posts
|
TODO: Salvador Romero Cortés: @acanas opción para editar posts
|
||||||
|
|
||||||
|
Version 20.33.11: Feb 23, 2021 Code refactoring in timeline. (305001 lines)
|
||||||
Version 20.33.10: Feb 23, 2021 Code refactoring related to writing a timeline notes and comments. (305038 lines)
|
Version 20.33.10: Feb 23, 2021 Code refactoring related to writing a timeline notes and comments. (305038 lines)
|
||||||
Version 20.33.9: Feb 22, 2021 Code refactoring related to writing a timeline comment. (304949 lines)
|
Version 20.33.9: Feb 22, 2021 Code refactoring related to writing a timeline comment. (304949 lines)
|
||||||
Version 20.33.8: Feb 22, 2021 Code refactoring related to writing a timeline note. (304971 lines)
|
Version 20.33.8: Feb 22, 2021 Code refactoring related to writing a timeline note. (304971 lines)
|
||||||
|
|
|
@ -426,7 +426,6 @@ static void TL_ShowTimeline (struct TL_Timeline *Timeline,
|
||||||
struct TL_Not_Note Not;
|
struct TL_Not_Note Not;
|
||||||
unsigned NumPubs;
|
unsigned NumPubs;
|
||||||
bool GlobalTimeline = (Gbl.Usrs.Other.UsrDat.UsrCod <= 0);
|
bool GlobalTimeline = (Gbl.Usrs.Other.UsrDat.UsrCod <= 0);
|
||||||
bool ItsMe = Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Title,
|
Box_BoxBegin (NULL,Title,
|
||||||
|
@ -438,7 +437,8 @@ static void TL_ShowTimeline (struct TL_Timeline *Timeline,
|
||||||
TL_Who_PutFormWho (Timeline);
|
TL_Who_PutFormWho (Timeline);
|
||||||
|
|
||||||
/***** Form to write a new post *****/
|
/***** Form to write a new post *****/
|
||||||
if (GlobalTimeline || ItsMe)
|
if (GlobalTimeline ||
|
||||||
|
Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||||
TL_Pst_PutFormToWriteNewPost (Timeline);
|
TL_Pst_PutFormToWriteNewPost (Timeline);
|
||||||
|
|
||||||
/***** New publications refreshed dynamically via AJAX *****/
|
/***** New publications refreshed dynamically via AJAX *****/
|
||||||
|
|
|
@ -608,13 +608,12 @@ static void TL_Com_WriteAuthorName (const struct UsrData *UsrDat) // Author
|
||||||
{
|
{
|
||||||
extern const char *Txt_My_public_profile;
|
extern const char *Txt_My_public_profile;
|
||||||
extern const char *Txt_Another_user_s_profile;
|
extern const char *Txt_Another_user_s_profile;
|
||||||
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
|
|
||||||
|
|
||||||
/***** Show user's name inside form to go to user's public profile *****/
|
/***** Show user's name inside form to go to user's public profile *****/
|
||||||
Frm_StartFormUnique (ActSeeOthPubPrf);
|
Frm_StartFormUnique (ActSeeOthPubPrf);
|
||||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||||
HTM_BUTTON_SUBMIT_Begin (ItsMe ? 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 TL_COM_AUTHOR TL_COMM_AUTHOR_WIDTH DAT_BOLD",NULL);
|
||||||
HTM_Txt (UsrDat->FullName);
|
HTM_Txt (UsrDat->FullName);
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
@ -955,7 +954,6 @@ static void TL_Com_RemoveComment (void)
|
||||||
extern const char *Txt_The_comment_no_longer_exists;
|
extern const char *Txt_The_comment_no_longer_exists;
|
||||||
extern const char *Txt_Comment_removed;
|
extern const char *Txt_Comment_removed;
|
||||||
struct TL_Com_Comment Com;
|
struct TL_Com_Comment Com;
|
||||||
bool ItsMe;
|
|
||||||
|
|
||||||
/***** Initialize image *****/
|
/***** Initialize image *****/
|
||||||
Med_MediaConstructor (&Com.Content.Media);
|
Med_MediaConstructor (&Com.Content.Media);
|
||||||
|
@ -966,8 +964,7 @@ static void TL_Com_RemoveComment (void)
|
||||||
|
|
||||||
if (Com.PubCod > 0)
|
if (Com.PubCod > 0)
|
||||||
{
|
{
|
||||||
ItsMe = Usr_ItsMe (Com.UsrCod);
|
if (Usr_ItsMe (Com.UsrCod)) // I am the author of this comment
|
||||||
if (ItsMe) // I am the author of this comment
|
|
||||||
{
|
{
|
||||||
/***** Remove media associated to comment
|
/***** Remove media associated to comment
|
||||||
and delete comment from database *****/
|
and delete comment from database *****/
|
||||||
|
|
|
@ -214,24 +214,19 @@ void TL_Fav_UnfNoteGbl (void)
|
||||||
void TL_Fav_PutFormToFavUnfNote (const struct TL_Not_Note *Not,
|
void TL_Fav_PutFormToFavUnfNote (const struct TL_Not_Note *Not,
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
||||||
{
|
{
|
||||||
bool IAmTheAuthor;
|
|
||||||
bool IAmAFaverOfThisNot;
|
|
||||||
|
|
||||||
/***** Put form to fav/unfav this note *****/
|
/***** Put form to fav/unfav this note *****/
|
||||||
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
||||||
IAmTheAuthor = Usr_ItsMe (Not->UsrCod);
|
|
||||||
if (Not->Unavailable || // Unavailable notes can not be favourited
|
if (Not->Unavailable || // Unavailable notes can not be favourited
|
||||||
IAmTheAuthor) // I am the author
|
Usr_ItsMe (Not->UsrCod)) // I am the author
|
||||||
/* Put disabled icon */
|
/* Put disabled icon */
|
||||||
TL_Fav_PutDisabledIconFav (Not->NumFavs);
|
TL_Fav_PutDisabledIconFav (Not->NumFavs);
|
||||||
else // Available and I am not the author
|
else // Available and I am not the author
|
||||||
{
|
{
|
||||||
/* Put icon to fav/unfav */
|
/* Put icon to fav/unfav */
|
||||||
IAmAFaverOfThisNot = TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
if (TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited this note
|
||||||
if (IAmAFaverOfThisNot) // I have favourited this note
|
|
||||||
TL_Fav_PutFormToUnfNote (Not->NotCod);
|
TL_Fav_PutFormToUnfNote (Not->NotCod);
|
||||||
else // I am not a faver of this note
|
else // I am not a faver of this note
|
||||||
TL_Fav_PutFormToFavNote (Not->NotCod);
|
TL_Fav_PutFormToFavNote (Not->NotCod);
|
||||||
}
|
}
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
@ -242,7 +237,6 @@ void TL_Fav_PutFormToFavUnfNote (const struct TL_Not_Note *Not,
|
||||||
|
|
||||||
static void TL_Fav_FavNote (struct TL_Not_Note *Not)
|
static void TL_Fav_FavNote (struct TL_Not_Note *Not)
|
||||||
{
|
{
|
||||||
bool ItsMe;
|
|
||||||
long OriginalPubCod;
|
long OriginalPubCod;
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
|
@ -251,8 +245,8 @@ static void TL_Fav_FavNote (struct TL_Not_Note *Not)
|
||||||
|
|
||||||
if (Not->NotCod > 0)
|
if (Not->NotCod > 0)
|
||||||
{
|
{
|
||||||
ItsMe = Usr_ItsMe (Not->UsrCod);
|
if (Gbl.Usrs.Me.Logged &&
|
||||||
if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
!Usr_ItsMe (Not->UsrCod)) // I am not the author
|
||||||
if (!TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
if (!TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the note
|
||||||
{
|
{
|
||||||
|
@ -281,17 +275,15 @@ static void TL_Fav_FavNote (struct TL_Not_Note *Not)
|
||||||
static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
|
static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
|
||||||
{
|
{
|
||||||
long OriginalPubCod;
|
long OriginalPubCod;
|
||||||
bool ItsMe;
|
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
Not->NotCod = TL_Not_GetParamNotCod ();
|
Not->NotCod = TL_Not_GetParamNotCod ();
|
||||||
TL_Not_GetDataOfNoteByCod (Not);
|
TL_Not_GetDataOfNoteByCod (Not);
|
||||||
|
|
||||||
if (Not->NotCod > 0)
|
if (Not->NotCod > 0)
|
||||||
{
|
|
||||||
ItsMe = Usr_ItsMe (Not->UsrCod);
|
|
||||||
if (Not->NumFavs &&
|
if (Not->NumFavs &&
|
||||||
Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
Gbl.Usrs.Me.Logged &&
|
||||||
|
!Usr_ItsMe (Not->UsrCod)) // I am not the author
|
||||||
if (TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
if (TL_Fav_CheckIfNoteIsFavedByUsr (Not->NotCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the note
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the note
|
||||||
{
|
{
|
||||||
|
@ -310,7 +302,6 @@ static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
|
||||||
if (OriginalPubCod > 0)
|
if (OriginalPubCod > 0)
|
||||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod);
|
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -383,24 +374,19 @@ void TL_Fav_UnfCommentGbl (void)
|
||||||
void TL_Fav_PutFormToFavUnfComment (const struct TL_Com_Comment *Com,
|
void TL_Fav_PutFormToFavUnfComment (const struct TL_Com_Comment *Com,
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
||||||
{
|
{
|
||||||
bool IAmTheAuthor;
|
|
||||||
bool IAmAFaverOfThisCom;
|
|
||||||
|
|
||||||
/***** Put form to fav/unfav this comment *****/
|
/***** Put form to fav/unfav this comment *****/
|
||||||
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
||||||
IAmTheAuthor = Usr_ItsMe (Com->UsrCod);
|
if (Usr_ItsMe (Com->UsrCod)) // I am the author
|
||||||
if (IAmTheAuthor) // I am the author
|
|
||||||
/* Put disabled icon */
|
/* Put disabled icon */
|
||||||
TL_Fav_PutDisabledIconFav (Com->NumFavs);
|
TL_Fav_PutDisabledIconFav (Com->NumFavs);
|
||||||
else // I am not the author
|
else // I am not the author
|
||||||
{
|
{
|
||||||
/* Put icon to mark this comment as favourite */
|
/* Put icon to mark this comment as favourite */
|
||||||
IAmAFaverOfThisCom = TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
if (TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited this comment
|
||||||
if (IAmAFaverOfThisCom) // I have favourited this comment
|
|
||||||
/* Put icon to unfav this publication and list of users */
|
/* Put icon to unfav this publication and list of users */
|
||||||
TL_Fav_PutFormToUnfComment (Com->PubCod);
|
TL_Fav_PutFormToUnfComment (Com->PubCod);
|
||||||
else // I am not a favouriter
|
else // I am not a favouriter
|
||||||
/* Put icon to fav this publication and list of users */
|
/* Put icon to fav this publication and list of users */
|
||||||
TL_Fav_PutFormToFavComment (Com->PubCod);
|
TL_Fav_PutFormToFavComment (Com->PubCod);
|
||||||
}
|
}
|
||||||
|
@ -412,8 +398,6 @@ void TL_Fav_PutFormToFavUnfComment (const struct TL_Com_Comment *Com,
|
||||||
|
|
||||||
static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
|
static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
|
||||||
{
|
{
|
||||||
bool IAmTheAuthor;
|
|
||||||
|
|
||||||
/***** Initialize image *****/
|
/***** Initialize image *****/
|
||||||
Med_MediaConstructor (&Com->Content.Media);
|
Med_MediaConstructor (&Com->Content.Media);
|
||||||
|
|
||||||
|
@ -422,9 +406,7 @@ static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
|
||||||
TL_Com_GetDataOfCommByCod (Com);
|
TL_Com_GetDataOfCommByCod (Com);
|
||||||
|
|
||||||
if (Com->PubCod > 0)
|
if (Com->PubCod > 0)
|
||||||
{
|
if (!Usr_ItsMe (Com->UsrCod)) // I am not the author
|
||||||
IAmTheAuthor = Usr_ItsMe (Com->UsrCod);
|
|
||||||
if (!IAmTheAuthor) // I am not the author
|
|
||||||
if (!TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
if (!TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have not yet favourited the comment
|
||||||
{
|
{
|
||||||
|
@ -445,7 +427,6 @@ static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
|
||||||
TL_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,
|
TL_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,
|
||||||
Ntf_EVENT_TIMELINE_FAV);
|
Ntf_EVENT_TIMELINE_FAV);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/***** Free image *****/
|
/***** Free image *****/
|
||||||
Med_MediaDestructor (&Com->Content.Media);
|
Med_MediaDestructor (&Com->Content.Media);
|
||||||
|
@ -453,8 +434,6 @@ static void TL_Fav_FavComment (struct TL_Com_Comment *Com)
|
||||||
|
|
||||||
static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
|
static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
|
||||||
{
|
{
|
||||||
bool IAmTheAuthor;
|
|
||||||
|
|
||||||
/***** Initialize image *****/
|
/***** Initialize image *****/
|
||||||
Med_MediaConstructor (&Com->Content.Media);
|
Med_MediaConstructor (&Com->Content.Media);
|
||||||
|
|
||||||
|
@ -463,10 +442,8 @@ static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
|
||||||
TL_Com_GetDataOfCommByCod (Com);
|
TL_Com_GetDataOfCommByCod (Com);
|
||||||
|
|
||||||
if (Com->PubCod > 0)
|
if (Com->PubCod > 0)
|
||||||
{
|
|
||||||
IAmTheAuthor = Usr_ItsMe (Com->UsrCod);
|
|
||||||
if (Com->NumFavs &&
|
if (Com->NumFavs &&
|
||||||
!IAmTheAuthor) // I am not the author
|
!Usr_ItsMe (Com->UsrCod)) // I am not the author
|
||||||
if (TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
if (TL_Fav_CheckIfCommIsFavedByUsr (Com->PubCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the comment
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the comment
|
||||||
{
|
{
|
||||||
|
@ -483,7 +460,6 @@ static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
|
||||||
/***** Mark possible notifications on this comment as removed *****/
|
/***** Mark possible notifications on this comment as removed *****/
|
||||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,Com->PubCod);
|
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,Com->PubCod);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/***** Free image *****/
|
/***** Free image *****/
|
||||||
Med_MediaDestructor (&Com->Content.Media);
|
Med_MediaDestructor (&Com->Content.Media);
|
||||||
|
|
|
@ -267,7 +267,6 @@ static void TL_Not_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod
|
||||||
extern const char *Txt_Another_user_s_profile;
|
extern const char *Txt_Another_user_s_profile;
|
||||||
extern const char *Txt_TIMELINE_NOTE_TOP_MESSAGES[TL_NUM_TOP_MESSAGES];
|
extern const char *Txt_TIMELINE_NOTE_TOP_MESSAGES[TL_NUM_TOP_MESSAGES];
|
||||||
struct UsrData PublisherDat;
|
struct UsrData PublisherDat;
|
||||||
bool ItsMe = Usr_ItsMe (PublisherCod);
|
|
||||||
|
|
||||||
/***** Initialize structure with user's data *****/
|
/***** Initialize structure with user's data *****/
|
||||||
Usr_UsrDataConstructor (&PublisherDat);
|
Usr_UsrDataConstructor (&PublisherDat);
|
||||||
|
@ -281,8 +280,8 @@ static void TL_Not_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod
|
||||||
/***** Show user's name inside form to go to user's public profile *****/
|
/***** Show user's name inside form to go to user's public profile *****/
|
||||||
Frm_StartFormUnique (ActSeeOthPubPrf);
|
Frm_StartFormUnique (ActSeeOthPubPrf);
|
||||||
Usr_PutParamUsrCodEncrypted (PublisherDat.EnUsrCod);
|
Usr_PutParamUsrCodEncrypted (PublisherDat.EnUsrCod);
|
||||||
HTM_BUTTON_SUBMIT_Begin (ItsMe ? Txt_My_public_profile :
|
HTM_BUTTON_SUBMIT_Begin (Usr_ItsMe (PublisherCod) ? Txt_My_public_profile :
|
||||||
Txt_Another_user_s_profile,
|
Txt_Another_user_s_profile,
|
||||||
"BT_LINK TL_TOP_PUBLISHER",NULL);
|
"BT_LINK TL_TOP_PUBLISHER",NULL);
|
||||||
HTM_Txt (PublisherDat.FullName);
|
HTM_Txt (PublisherDat.FullName);
|
||||||
HTM_BUTTON_End ();
|
HTM_BUTTON_End ();
|
||||||
|
@ -374,13 +373,12 @@ void TL_Not_WriteAuthorName (const struct UsrData *UsrDat)
|
||||||
{
|
{
|
||||||
extern const char *Txt_My_public_profile;
|
extern const char *Txt_My_public_profile;
|
||||||
extern const char *Txt_Another_user_s_profile;
|
extern const char *Txt_Another_user_s_profile;
|
||||||
bool ItsMe = Usr_ItsMe (UsrDat->UsrCod);
|
|
||||||
|
|
||||||
/***** Show user's name inside form to go to user's public profile *****/
|
/***** Show user's name inside form to go to user's public profile *****/
|
||||||
Frm_StartFormUnique (ActSeeOthPubPrf);
|
Frm_StartFormUnique (ActSeeOthPubPrf);
|
||||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||||
HTM_BUTTON_SUBMIT_Begin (ItsMe ? 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_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH DAT_N_BOLD",
|
"BT_LINK TL_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH DAT_N_BOLD",
|
||||||
NULL);
|
NULL);
|
||||||
HTM_Txt (UsrDat->FullName);
|
HTM_Txt (UsrDat->FullName);
|
||||||
|
@ -1222,7 +1220,6 @@ static void TL_Not_RemoveNote (void)
|
||||||
extern const char *Txt_The_original_post_no_longer_exists;
|
extern const char *Txt_The_original_post_no_longer_exists;
|
||||||
extern const char *Txt_TIMELINE_Post_removed;
|
extern const char *Txt_TIMELINE_Post_removed;
|
||||||
struct TL_Not_Note Not;
|
struct TL_Not_Note Not;
|
||||||
bool ItsMe;
|
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
Not.NotCod = TL_Not_GetParamNotCod ();
|
Not.NotCod = TL_Not_GetParamNotCod ();
|
||||||
|
@ -1230,8 +1227,7 @@ static void TL_Not_RemoveNote (void)
|
||||||
|
|
||||||
if (Not.NotCod > 0)
|
if (Not.NotCod > 0)
|
||||||
{
|
{
|
||||||
ItsMe = Usr_ItsMe (Not.UsrCod);
|
if (Usr_ItsMe (Not.UsrCod)) // I am the author of this note
|
||||||
if (ItsMe) // I am the author of this note
|
|
||||||
{
|
{
|
||||||
/***** Delete note from database *****/
|
/***** Delete note from database *****/
|
||||||
TL_Not_RemoveNoteMediaAndDBEntries (&Not);
|
TL_Not_RemoveNoteMediaAndDBEntries (&Not);
|
||||||
|
|
|
@ -165,7 +165,6 @@ void TL_Sha_ShaNoteGbl (void)
|
||||||
static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
|
static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
|
||||||
{
|
{
|
||||||
struct TL_Pub_Publication Pub;
|
struct TL_Pub_Publication Pub;
|
||||||
bool ItsMe;
|
|
||||||
long OriginalPubCod;
|
long OriginalPubCod;
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
|
@ -173,9 +172,8 @@ static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
|
||||||
TL_Not_GetDataOfNoteByCod (Not);
|
TL_Not_GetDataOfNoteByCod (Not);
|
||||||
|
|
||||||
if (Not->NotCod > 0)
|
if (Not->NotCod > 0)
|
||||||
{
|
if (Gbl.Usrs.Me.Logged &&
|
||||||
ItsMe = Usr_ItsMe (Not->UsrCod);
|
!Usr_ItsMe (Not->UsrCod)) // I am not the author
|
||||||
if (Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
|
||||||
if (!TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
|
if (!TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod)) // Not yet shared by me
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // Not yet shared by me
|
||||||
{
|
{
|
||||||
|
@ -195,7 +193,6 @@ static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
|
||||||
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,
|
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,
|
||||||
Ntf_EVENT_TIMELINE_SHARE);
|
Ntf_EVENT_TIMELINE_SHARE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -224,19 +221,16 @@ void TL_Sha_UnsNoteGbl (void)
|
||||||
|
|
||||||
static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
|
static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
|
||||||
{
|
{
|
||||||
// extern const char *Txt_The_original_post_no_longer_exists;
|
|
||||||
long OriginalPubCod;
|
long OriginalPubCod;
|
||||||
bool ItsMe;
|
|
||||||
|
|
||||||
/***** Get data of note *****/
|
/***** Get data of note *****/
|
||||||
Not->NotCod = TL_Not_GetParamNotCod ();
|
Not->NotCod = TL_Not_GetParamNotCod ();
|
||||||
TL_Not_GetDataOfNoteByCod (Not);
|
TL_Not_GetDataOfNoteByCod (Not);
|
||||||
|
|
||||||
if (Not->NotCod > 0)
|
if (Not->NotCod > 0)
|
||||||
{
|
|
||||||
ItsMe = Usr_ItsMe (Not->UsrCod);
|
|
||||||
if (Not->NumShared &&
|
if (Not->NumShared &&
|
||||||
Gbl.Usrs.Me.Logged && !ItsMe) // I am not the author
|
Gbl.Usrs.Me.Logged &&
|
||||||
|
!Usr_ItsMe (Not->UsrCod)) // I am not the author
|
||||||
if (TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
|
if (TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod)) // I am a sharer
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I am a sharer
|
||||||
{
|
{
|
||||||
|
@ -258,28 +252,22 @@ static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
|
||||||
if (OriginalPubCod > 0)
|
if (OriginalPubCod > 0)
|
||||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod);
|
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TL_Sha_PutFormToShaUnsNote (const struct TL_Not_Note *Not,
|
void TL_Sha_PutFormToShaUnsNote (const struct TL_Not_Note *Not,
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
||||||
{
|
{
|
||||||
bool IAmTheAuthor;
|
|
||||||
bool IAmASharerOfThisNot;
|
|
||||||
|
|
||||||
/***** Put form to share/unshare this note *****/
|
/***** Put form to share/unshare this note *****/
|
||||||
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
||||||
IAmTheAuthor = Usr_ItsMe (Not->UsrCod);
|
|
||||||
if (Not->Unavailable || // Unavailable notes can not be shared
|
if (Not->Unavailable || // Unavailable notes can not be shared
|
||||||
IAmTheAuthor) // I am the author
|
Usr_ItsMe (Not->UsrCod)) // I am the author
|
||||||
/* Put disabled icon */
|
/* Put disabled icon */
|
||||||
TL_Sha_PutDisabledIconShare (Not->NumShared);
|
TL_Sha_PutDisabledIconShare (Not->NumShared);
|
||||||
else // Available and I am not the author
|
else // Available and I am not the author
|
||||||
{
|
{
|
||||||
/* Put icon to share/unshare */
|
/* Put icon to share/unshare */
|
||||||
IAmASharerOfThisNot = TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
|
if (TL_Sha_CheckIfNoteIsSharedByUsr (Not->NotCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have shared this note
|
||||||
if (IAmASharerOfThisNot) // I have shared this note
|
|
||||||
TL_Sha_PutFormToUnsNote (Not->NotCod);
|
TL_Sha_PutFormToUnsNote (Not->NotCod);
|
||||||
else // I have not shared this note
|
else // I have not shared this note
|
||||||
TL_Sha_PutFormToShaNote (Not->NotCod);
|
TL_Sha_PutFormToShaNote (Not->NotCod);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user