Version 20.68.8: Apr 30, 2021 Code refactoring in timeline.

This commit is contained in:
acanas 2021-04-30 00:12:54 +02:00
parent 573bcd95b3
commit f296981e43
7 changed files with 41 additions and 39 deletions

View File

@ -600,13 +600,14 @@ TODO: Salvador Romero Cort
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
*/
#define Log_PLATFORM_VERSION "SWAD 20.68.7 (2021-04-29)"
#define Log_PLATFORM_VERSION "SWAD 20.68.8 (2021-04-30)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 20.68.8: Apr 30, 2021 Code refactoring in timeline. (309751 lines)
Version 20.68.7: Apr 29, 2021 Code refactoring in timeline. (309749 lines)
Version 20.68.6: Apr 29, 2021 Code refactoring in timeline. (309738 lines)
Version 20.68.5: Apr 29, 2021 Fixed bug in matches. Reported by Jesús Garrido Alcázar. (309746 lines)

View File

@ -1213,6 +1213,7 @@ void Tml_Not_RemoveNoteGbl (void)
static void Tml_Not_RemoveNote (void)
{
extern const char *Txt_The_post_no_longer_exists;
extern const char *Txt_You_dont_have_permission_to_perform_this_action;
extern const char *Txt_TIMELINE_Post_removed;
struct Tml_Not_Note Not;
@ -1230,7 +1231,7 @@ static void Tml_Not_RemoveNote (void)
/***** Trivial check 2: Am I the author of this note *****/
if (!Usr_ItsMe (Not.UsrCod))
{
Ale_ShowAlert (Ale_ERROR,"You are not the author.");
Ale_ShowAlert (Ale_ERROR,Txt_You_dont_have_permission_to_perform_this_action);
return;
}
@ -1318,7 +1319,7 @@ static void Tml_Not_GetDataOfNoteFromRow (MYSQL_ROW row,struct Tml_Not_Note *Not
row[3]: UsrCod
row[4]: HieCod
row[5]: Unavailable
row[5]: UNIX_TIMESTAMP(TimeNote)
row[6]: UNIX_TIMESTAMP(TimeNote)
*/
/***** Get code (row[0]) *****/
Not->NotCod = Str_ConvertStrCodToLongCod (row[0]);

View File

@ -276,15 +276,13 @@ static void Tml_Pub_UpdateFirstLastPubCodesIntoSession (const struct Tml_Timelin
Tml_DB_UpdateLastPubCodInSession ();
break;
case Tml_GET_ONLY_OLD_PUBS: // Get only old publications
// The oldest publication code retrieved and shown
FirstPubCod = Timeline->Pubs.Bottom ? Timeline->Pubs.Bottom->PubCod :
0;
Tml_DB_UpdateFirstPubCodInSession (FirstPubCod);
break;
case Tml_GET_RECENT_TIMELINE: // Get last publications
// The oldest publication code retrieved and shown
FirstPubCod = Timeline->Pubs.Bottom ? Timeline->Pubs.Bottom->PubCod :
0;
if (Timeline->WhatToGet == Tml_GET_ONLY_OLD_PUBS)
Tml_DB_UpdateFirstPubCodInSession (FirstPubCod);
else
Tml_DB_UpdateFirstLastPubCodsInSession (FirstPubCod);
break;
}

View File

@ -348,6 +348,7 @@ static void Tml_Usr_PutDisabledIconFavSha (Tml_Usr_FavSha_t FavSha,
bool Tml_Usr_CheckIfICanFavSha (long Cod,long UsrCod)
{
extern const char *Txt_The_post_no_longer_exists;
extern const char *Txt_You_dont_have_permission_to_perform_this_action;
/***** Trivial check 1: note/comment code should be > 0 *****/
if (Cod <= 0)
@ -360,8 +361,8 @@ bool Tml_Usr_CheckIfICanFavSha (long Cod,long UsrCod)
I can not fav/share my own notes/comments *****/
if (!Gbl.Usrs.Me.Logged || Usr_ItsMe (UsrCod))
{
Err_NoPermissionExit ();
return false; // Not reached
Ale_ShowAlert (Ale_ERROR,Txt_You_dont_have_permission_to_perform_this_action);
return false;
}
return true;
@ -374,6 +375,7 @@ bool Tml_Usr_CheckIfICanFavSha (long Cod,long UsrCod)
bool Tml_Usr_CheckIfICanRemove (long Cod,long UsrCod)
{
extern const char *Txt_The_post_no_longer_exists;
extern const char *Txt_You_dont_have_permission_to_perform_this_action;
/***** Trivial check 1: note/comment code should be > 0 *****/
if (Cod <= 0)
@ -386,8 +388,8 @@ bool Tml_Usr_CheckIfICanRemove (long Cod,long UsrCod)
I can only remove my own notes/comments *****/
if (!Gbl.Usrs.Me.Logged || !Usr_ItsMe (UsrCod))
{
Err_NoPermissionExit ();
return false; // Not reached
Ale_ShowAlert (Ale_ERROR,Txt_You_dont_have_permission_to_perform_this_action);
return false;
}
return true;