mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-08 01:35:32 +02:00
Version 20.40.2: Mar 03, 2021 Code refactoring in fav/share timeline.
This commit is contained in:
parent
c4adac88ed
commit
dca0e83339
|
@ -598,10 +598,11 @@ 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
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.40.1 (2021-03-03)"
|
#define Log_PLATFORM_VERSION "SWAD 20.40.2 (2021-03-03)"
|
||||||
#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"
|
||||||
/*
|
/*
|
||||||
|
Version 20.40.2: Mar 03, 2021 Code refactoring in fav/share timeline. (305519 lines)
|
||||||
Version 20.40.1: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines)
|
Version 20.40.1: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines)
|
||||||
Version 20.40: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines)
|
Version 20.40: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines)
|
||||||
Version 20.39.11: Mar 02, 2021 Code refactoring in fav/share timeline. (305525 lines)
|
Version 20.39.11: Mar 02, 2021 Code refactoring in fav/share timeline. (305525 lines)
|
||||||
|
|
|
@ -644,9 +644,10 @@ static void TL_Com_WriteButtons (const struct TL_Timeline *Timeline,
|
||||||
/***** 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=\"TL_FAV_COM TL_FAV_WIDTH\"",
|
||||||
Gbl.UniqueNameEncrypted,NumDiv);
|
Gbl.UniqueNameEncrypted,NumDiv);
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_COMM,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_COMM,
|
||||||
Com->PubCod,Com->UsrCod,Com->NumFavs,
|
Com->PubCod,Com->UsrCod,Com->NumFavs,
|
||||||
TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
|
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
|
||||||
/***** Foot column 2: icon to remove this comment *****/
|
/***** Foot column 2: icon to remove this comment *****/
|
||||||
|
|
|
@ -84,7 +84,7 @@ void TL_Fav_ShowAllFaversNoteGbl (void)
|
||||||
TL_Not_GetDataOfNoteByCod (&Not);
|
TL_Not_GetDataOfNoteByCod (&Not);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav/unfav *****/
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_NOTE,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_NOTE,
|
||||||
Not.NotCod,Not.UsrCod,Not.NumFavs,
|
Not.NotCod,Not.UsrCod,Not.NumFavs,
|
||||||
TL_Usr_SHOW_ALL_USRS);
|
TL_Usr_SHOW_ALL_USRS);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ void TL_Fav_FavNoteGbl (void)
|
||||||
TL_Fav_FavNote (&Not);
|
TL_Fav_FavNote (&Not);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to unfav *****/
|
/***** Write HTML inside DIV with form to unfav *****/
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_NOTE,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_NOTE,
|
||||||
Not.NotCod,Not.UsrCod,Not.NumFavs,
|
Not.NotCod,Not.UsrCod,Not.NumFavs,
|
||||||
TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ void TL_Fav_UnfNoteGbl (void)
|
||||||
TL_Fav_UnfNote (&Not);
|
TL_Fav_UnfNote (&Not);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav *****/
|
/***** Write HTML inside DIV with form to fav *****/
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_NOTE,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_NOTE,
|
||||||
Not.NotCod,Not.UsrCod,Not.NumFavs,
|
Not.NotCod,Not.UsrCod,Not.NumFavs,
|
||||||
TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ void TL_Fav_ShowAllFaversComGbl (void)
|
||||||
Med_MediaDestructor (&Com.Content.Media);
|
Med_MediaDestructor (&Com.Content.Media);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav/unfav *****/
|
/***** Write HTML inside DIV with form to fav/unfav *****/
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_COMM,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_COMM,
|
||||||
Com.PubCod,Com.UsrCod,Com.NumFavs,
|
Com.PubCod,Com.UsrCod,Com.NumFavs,
|
||||||
TL_Usr_SHOW_ALL_USRS);
|
TL_Usr_SHOW_ALL_USRS);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ void TL_Fav_FavCommGbl (void)
|
||||||
TL_Fav_FavComm (&Com);
|
TL_Fav_FavComm (&Com);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to unfav *****/
|
/***** Write HTML inside DIV with form to unfav *****/
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_COMM,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_COMM,
|
||||||
Com.PubCod,Com.UsrCod,Com.NumFavs,
|
Com.PubCod,Com.UsrCod,Com.NumFavs,
|
||||||
TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ void TL_Fav_UnfCommGbl (void)
|
||||||
TL_Fav_UnfComm (&Com);
|
TL_Fav_UnfComm (&Com);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to fav *****/
|
/***** Write HTML inside DIV with form to fav *****/
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_COMM,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_COMM,
|
||||||
Com.PubCod,Com.UsrCod,Com.NumFavs,
|
Com.PubCod,Com.UsrCod,Com.NumFavs,
|
||||||
TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
}
|
}
|
||||||
|
@ -345,28 +345,3 @@ static void TL_Fav_UnfComm (struct TL_Com_Comment *Com)
|
||||||
/***** Free image *****/
|
/***** Free image *****/
|
||||||
Med_MediaDestructor (&Com->Content.Media);
|
Med_MediaDestructor (&Com->Content.Media);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/**************** Put icon to fav/unfav and list of favers *******************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void TL_Fav_PutIconToFavUnf (TL_Usr_FavSha_t FavSha,
|
|
||||||
long Cod,long UsrCod,unsigned NumUsrs,
|
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
|
||||||
{
|
|
||||||
/***** Put form to fav/unfav this comment *****/
|
|
||||||
/* Begin container */
|
|
||||||
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
|
||||||
|
|
||||||
/* Icon to fav/unfav */
|
|
||||||
if (Usr_ItsMe (UsrCod)) // I am the author ==> I can not fav/unfav
|
|
||||||
TL_Usr_PutDisabledIconFavSha (FavSha,NumUsrs);
|
|
||||||
else // I am not the author
|
|
||||||
TL_Frm_PutFormToFavUnfShaUns (FavSha,Cod);
|
|
||||||
|
|
||||||
/* End container */
|
|
||||||
HTM_DIV_End ();
|
|
||||||
|
|
||||||
/***** Show who have faved this note/comment *****/
|
|
||||||
TL_Usr_GetAndShowSharersOrFavers (FavSha,Cod,UsrCod,NumUsrs,HowManyUsrs);
|
|
||||||
}
|
|
||||||
|
|
|
@ -55,8 +55,4 @@ void TL_Fav_FavCommGbl (void);
|
||||||
void TL_Fav_UnfCommUsr (void);
|
void TL_Fav_UnfCommUsr (void);
|
||||||
void TL_Fav_UnfCommGbl (void);
|
void TL_Fav_UnfCommGbl (void);
|
||||||
|
|
||||||
void TL_Fav_PutIconToFavUnf (TL_Usr_FavSha_t FavSha,
|
|
||||||
long Cod,long UsrCod,unsigned NumUsrs,
|
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -841,7 +841,7 @@ static void TL_Not_WriteFavShaRem (const struct TL_Timeline *Timeline,
|
||||||
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=\"TL_FAV_NOT TL_FAV_NOT_WIDTH\"",
|
||||||
Gbl.UniqueNameEncrypted,NumDiv);
|
Gbl.UniqueNameEncrypted,NumDiv);
|
||||||
TL_Fav_PutIconToFavUnf (TL_Usr_FAV_UNF_NOTE,
|
TL_Usr_PutIconFavSha (TL_Usr_FAV_UNF_NOTE,
|
||||||
Not->NotCod,Not->UsrCod,Not->NumFavs,
|
Not->NotCod,Not->UsrCod,Not->NumFavs,
|
||||||
TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
@ -850,7 +850,9 @@ static void TL_Not_WriteFavShaRem (const struct TL_Timeline *Timeline,
|
||||||
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=\"TL_SHA_NOT TL_SHA_NOT_WIDTH\"",
|
||||||
Gbl.UniqueNameEncrypted,NumDiv);
|
Gbl.UniqueNameEncrypted,NumDiv);
|
||||||
TL_Sha_PutIconToShaUnsNote (Not,TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_PutIconFavSha (TL_Usr_SHA_UNS_NOTE,
|
||||||
|
Not->NotCod,Not->UsrCod,Not->NumShared,
|
||||||
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
|
||||||
/***** Foot column 3: icon to remove this note *****/
|
/***** Foot column 3: icon to remove this note *****/
|
||||||
|
|
|
@ -81,7 +81,9 @@ void TL_Sha_ShowAllSharersNoteGbl (void)
|
||||||
TL_Not_GetDataOfNoteByCod (&Not);
|
TL_Not_GetDataOfNoteByCod (&Not);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to share/unshare *****/
|
/***** Write HTML inside DIV with form to share/unshare *****/
|
||||||
TL_Sha_PutIconToShaUnsNote (&Not,TL_Usr_SHOW_ALL_USRS);
|
TL_Usr_PutIconFavSha (TL_Usr_SHA_UNS_NOTE,
|
||||||
|
Not.NotCod,Not.UsrCod,Not.NumShared,
|
||||||
|
TL_Usr_SHOW_ALL_USRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TL_Sha_ShaNoteUsr (void)
|
void TL_Sha_ShaNoteUsr (void)
|
||||||
|
@ -101,7 +103,9 @@ void TL_Sha_ShaNoteGbl (void)
|
||||||
TL_Sha_ShaNote (&Not);
|
TL_Sha_ShaNote (&Not);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to unshare *****/
|
/***** Write HTML inside DIV with form to unshare *****/
|
||||||
TL_Sha_PutIconToShaUnsNote (&Not,TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_PutIconFavSha (TL_Usr_SHA_UNS_NOTE,
|
||||||
|
Not.NotCod,Not.UsrCod,Not.NumShared,
|
||||||
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
|
static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
|
||||||
|
@ -160,7 +164,9 @@ void TL_Sha_UnsNoteGbl (void)
|
||||||
TL_Sha_UnsNote (&Not);
|
TL_Sha_UnsNote (&Not);
|
||||||
|
|
||||||
/***** Write HTML inside DIV with form to share *****/
|
/***** Write HTML inside DIV with form to share *****/
|
||||||
TL_Sha_PutIconToShaUnsNote (&Not,TL_Usr_SHOW_FEW_USRS);
|
TL_Usr_PutIconFavSha (TL_Usr_SHA_UNS_NOTE,
|
||||||
|
Not.NotCod,Not.UsrCod,Not.NumShared,
|
||||||
|
TL_Usr_SHOW_FEW_USRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
|
static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
|
||||||
|
@ -186,28 +192,3 @@ 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_PutIconToShaUnsNote (const struct TL_Not_Note *Not,
|
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
|
||||||
{
|
|
||||||
/***** Put form to share/unshare this note *****/
|
|
||||||
/* Begin container */
|
|
||||||
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
|
||||||
|
|
||||||
/* Icon to share */
|
|
||||||
if (Not->Unavailable || // Unavailable notes can not be shared
|
|
||||||
Usr_ItsMe (Not->UsrCod)) // I am the author
|
|
||||||
/* Put disabled icon */
|
|
||||||
TL_Usr_PutDisabledIconFavSha (TL_Usr_SHA_UNS_NOTE,Not->NumShared);
|
|
||||||
else // Available and I am not the author
|
|
||||||
/* Put icon to share/unshare */
|
|
||||||
TL_Frm_PutFormToFavUnfShaUns (TL_Usr_SHA_UNS_NOTE,Not->NotCod);
|
|
||||||
|
|
||||||
|
|
||||||
/* End container */
|
|
||||||
HTM_DIV_End ();
|
|
||||||
|
|
||||||
/***** Show who have shared this note *****/
|
|
||||||
TL_Usr_GetAndShowSharersOrFavers (TL_Usr_SHA_UNS_NOTE,
|
|
||||||
Not->NotCod,Not->UsrCod,Not->NumShared,HowManyUsrs);
|
|
||||||
}
|
|
||||||
|
|
|
@ -50,7 +50,5 @@ void TL_Sha_ShaNoteUsr (void);
|
||||||
void TL_Sha_ShaNoteGbl (void);
|
void TL_Sha_ShaNoteGbl (void);
|
||||||
void TL_Sha_UnsNoteUsr (void);
|
void TL_Sha_UnsNoteUsr (void);
|
||||||
void TL_Sha_UnsNoteGbl (void);
|
void TL_Sha_UnsNoteGbl (void);
|
||||||
void TL_Sha_PutIconToShaUnsNote (const struct TL_Not_Note *Not,
|
|
||||||
TL_Usr_HowManyUsrs_t HowManyUsrs);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -287,6 +287,31 @@ unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
|
||||||
return 0; // Not reached
|
return 0; // Not reached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/**************** Put icon to fav/unfav and list of favers *******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void TL_Usr_PutIconFavSha (TL_Usr_FavSha_t FavSha,
|
||||||
|
long Cod,long UsrCod,unsigned NumUsrs,
|
||||||
|
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
||||||
|
{
|
||||||
|
/***** Put form to fav/unfav or share/unshare this note/comment *****/
|
||||||
|
/* Begin container */
|
||||||
|
HTM_DIV_Begin ("class=\"TL_ICO\"");
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
TL_Usr_PutDisabledIconFavSha (FavSha,NumUsrs);
|
||||||
|
else // I am not the author
|
||||||
|
TL_Frm_PutFormToFavUnfShaUns (FavSha,Cod);
|
||||||
|
|
||||||
|
/* End container */
|
||||||
|
HTM_DIV_End ();
|
||||||
|
|
||||||
|
/***** Show who have faved/shared this note/comment *****/
|
||||||
|
TL_Usr_GetAndShowSharersOrFavers (FavSha,Cod,UsrCod,NumUsrs,HowManyUsrs);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Put disabled icon to mark as favourite *******************/
|
/****************** Put disabled icon to mark as favourite *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -81,6 +81,9 @@ unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
|
||||||
long Cod,long UsrCod,unsigned MaxUsrs,
|
long Cod,long UsrCod,unsigned MaxUsrs,
|
||||||
MYSQL_RES **mysql_res);
|
MYSQL_RES **mysql_res);
|
||||||
|
|
||||||
|
void TL_Usr_PutIconFavSha (TL_Usr_FavSha_t FavSha,
|
||||||
|
long Cod,long UsrCod,unsigned NumUsrs,
|
||||||
|
TL_Usr_HowManyUsrs_t HowManyUsrs);
|
||||||
void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,unsigned NumUsrs);
|
void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,unsigned NumUsrs);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user