mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-01 22:35:28 +02:00
Version19.109.5
This commit is contained in:
parent
c9c91afb45
commit
25dd8e6c92
|
@ -4984,6 +4984,8 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
|
||||||
/**************************** Private prototypes *****************************/
|
/**************************** Private prototypes *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static const char *Act_GetActionTextFromDB (long ActCod); // TODO: Remove when database table actions is removed
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Get action from permanent action code ********************/
|
/****************** Get action from permanent action code ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -5189,7 +5191,7 @@ const char *Act_GetActionText (Act_Action_t Action)
|
||||||
/********************* Get text for action from database *********************/
|
/********************* Get text for action from database *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
const char *Act_GetActionTextFromDB (long ActCod) // TODO: Remove when database table actions is removed
|
static const char *Act_GetActionTextFromDB (long ActCod) // TODO: Remove when database table actions is removed
|
||||||
{
|
{
|
||||||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
|
|
@ -1699,7 +1699,6 @@ const char *Act_GetIcon (Act_Action_t Action);
|
||||||
const char *Act_GetTitleAction (Act_Action_t Action);
|
const char *Act_GetTitleAction (Act_Action_t Action);
|
||||||
const char *Act_GetSubtitleAction (Act_Action_t Action);
|
const char *Act_GetSubtitleAction (Act_Action_t Action);
|
||||||
const char *Act_GetActionText (Act_Action_t Action);
|
const char *Act_GetActionText (Act_Action_t Action);
|
||||||
const char *Act_GetActionTextFromDB (long ActCod);
|
|
||||||
|
|
||||||
void Act_AdjustActionWhenNoUsrLogged (void);
|
void Act_AdjustActionWhenNoUsrLogged (void);
|
||||||
void Act_AdjustCurrentAction (void);
|
void Act_AdjustCurrentAction (void);
|
||||||
|
|
|
@ -492,7 +492,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 19.109.4 (2020-01-02)"
|
#define Log_PLATFORM_VERSION "SWAD 19.109.5 (2020-01-02)"
|
||||||
#define CSS_FILE "swad19.101.5.css"
|
#define CSS_FILE "swad19.101.5.css"
|
||||||
#define JS_FILE "swad19.91.1.js"
|
#define JS_FILE "swad19.91.1.js"
|
||||||
/*
|
/*
|
||||||
|
@ -502,6 +502,7 @@ ps2pdf source.ps destination.pdf
|
||||||
// TODO: Version 19.1xx: Jan xx, 2020 Map in country information. (? lines)
|
// TODO: Version 19.1xx: Jan xx, 2020 Map in country information. (? lines)
|
||||||
// TODO: Version 19.1xx: Jan xx, 2020 Map in institution information. (? lines)
|
// TODO: Version 19.1xx: Jan xx, 2020 Map in institution information. (? lines)
|
||||||
|
|
||||||
|
Version 19.109.5: Jan 02, 2020 Changed query in last clicks. (278708 lines)
|
||||||
Version 19.109.4: Jan 02, 2020 Code refactoring in actions. (278712 lines)
|
Version 19.109.4: Jan 02, 2020 Code refactoring in actions. (278712 lines)
|
||||||
Version 19.109.3: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278839 lines)
|
Version 19.109.3: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278839 lines)
|
||||||
Version 19.109.2: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278623 lines)
|
Version 19.109.2: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278623 lines)
|
||||||
|
|
49
swad_log.c
49
swad_log.c
|
@ -231,6 +231,7 @@ void Log_GetAndShowLastClicks (void)
|
||||||
unsigned long NumRow;
|
unsigned long NumRow;
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
long ActCod;
|
long ActCod;
|
||||||
|
Act_Action_t Action;
|
||||||
const char *ClassRow;
|
const char *ClassRow;
|
||||||
time_t TimeDiff;
|
time_t TimeDiff;
|
||||||
struct Country Cty;
|
struct Country Cty;
|
||||||
|
@ -239,23 +240,18 @@ void Log_GetAndShowLastClicks (void)
|
||||||
struct Degree Deg;
|
struct Degree Deg;
|
||||||
|
|
||||||
/***** Get last clicks from database *****/
|
/***** Get last clicks from database *****/
|
||||||
/* Important for maximum performance:
|
|
||||||
do the LIMIT in the big log table before the JOIN */
|
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get last clicks",
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get last clicks",
|
||||||
"SELECT last_logs.LogCod,last_logs.ActCod,"
|
"SELECT LogCod," // row[0]
|
||||||
"last_logs.Dif,last_logs.Role,"
|
"ActCod," // row[1]
|
||||||
"last_logs.CtyCod,last_logs.InsCod,"
|
"UNIX_TIMESTAMP()-"
|
||||||
"last_logs.CtrCod,last_logs.DegCod,"
|
"UNIX_TIMESTAMP(ClickTime)," // row[2]
|
||||||
"actions.Txt"
|
"Role," // row[3]
|
||||||
" FROM"
|
"CtyCod," // row[4]
|
||||||
" (SELECT LogCod,ActCod,"
|
"InsCod," // row[5]
|
||||||
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(ClickTime) AS Dif,"
|
"CtrCod," // row[6]
|
||||||
"Role,CtyCod,InsCod,CtrCod,DegCod"
|
"DegCod" // row[7]
|
||||||
" FROM log_recent ORDER BY LogCod DESC LIMIT 20)"
|
" FROM log_recent"
|
||||||
" AS last_logs LEFT JOIN actions" // LEFT JOIN because action may be not present in table of actions
|
" ORDER BY LogCod DESC LIMIT 20");
|
||||||
" ON last_logs.ActCod=actions.ActCod"
|
|
||||||
" WHERE actions.Language='es'" // TODO: Change to user's language
|
|
||||||
" OR actions.Language IS NULL"); // When action is not present in table of actions
|
|
||||||
|
|
||||||
/***** Write list of connected users *****/
|
/***** Write list of connected users *****/
|
||||||
HTM_TABLE_BeginCenterPadding (1);
|
HTM_TABLE_BeginCenterPadding (1);
|
||||||
|
@ -280,9 +276,10 @@ void Log_GetAndShowLastClicks (void)
|
||||||
|
|
||||||
/* Get action code (row[1]) */
|
/* Get action code (row[1]) */
|
||||||
ActCod = Str_ConvertStrCodToLongCod (row[1]);
|
ActCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||||
|
Action = Act_GetActionFromActCod (ActCod);
|
||||||
|
|
||||||
/* Use a special color for this row depending on the action */
|
/* Use a special color for this row depending on the action */
|
||||||
ClassRow = (Act_GetBrowserTab (Act_GetActionFromActCod (ActCod)) == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW" :
|
ClassRow = (Act_GetBrowserTab (Action) == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW" :
|
||||||
(ActCod == Act_GetActCod (ActLogIn ) ||
|
(ActCod == Act_GetActCod (ActLogIn ) ||
|
||||||
ActCod == Act_GetActCod (ActLogInNew)) ? "DAT_SMALL_GREEN" :
|
ActCod == Act_GetActCod (ActLogInNew)) ? "DAT_SMALL_GREEN" :
|
||||||
(ActCod == Act_GetActCod (ActLogOut )) ? "DAT_SMALL_RED" :
|
(ActCod == Act_GetActCod (ActLogOut )) ? "DAT_SMALL_RED" :
|
||||||
|
@ -313,38 +310,36 @@ void Log_GetAndShowLastClicks (void)
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_CLK %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_CLK %s\"",ClassRow);
|
||||||
HTM_Txt (row[0]); // Click
|
HTM_Txt (row[0]); // Click
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_TIM %s\"",ClassRow); // Elapsed time
|
HTM_TD_Begin ("class=\"LC_TIM %s\"",ClassRow); // Elapsed time
|
||||||
Dat_WriteHoursMinutesSecondsFromSeconds (TimeDiff);
|
Dat_WriteHoursMinutesSecondsFromSeconds (TimeDiff);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_ROL %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_ROL %s\"",ClassRow);
|
||||||
HTM_Txt ( // Role
|
HTM_Txt ( // Role
|
||||||
Txt_ROLES_SINGUL_Abc[Rol_ConvertUnsignedStrToRole (row[3])][Usr_SEX_UNKNOWN]);
|
Txt_ROLES_SINGUL_Abc[Rol_ConvertUnsignedStrToRole (row[3])][Usr_SEX_UNKNOWN]);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_CTY %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_CTY %s\"",ClassRow);
|
||||||
HTM_Txt (Cty.Name[Gbl.Prefs.Language]); // Country
|
HTM_Txt (Cty.Name[Gbl.Prefs.Language]); // Country
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_INS %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_INS %s\"",ClassRow);
|
||||||
HTM_Txt (Ins.ShrtName); // Institution
|
HTM_Txt (Ins.ShrtName); // Institution
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_CTR %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_CTR %s\"",ClassRow);
|
||||||
HTM_Txt (Ctr.ShrtName); // Centre
|
HTM_Txt (Ctr.ShrtName); // Centre
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_DEG %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_DEG %s\"",ClassRow);
|
||||||
HTM_Txt (Deg.ShrtName); // Degree
|
HTM_Txt (Deg.ShrtName); // Degree
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LC_ACT %s\"",ClassRow);
|
HTM_TD_Begin ("class=\"LC_ACT %s\"",ClassRow);
|
||||||
if (row[8])
|
HTM_Txt (Act_GetActionText (Action)); // Action
|
||||||
if (row[8][0])
|
|
||||||
HTM_Txt (row[8]); // Action
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
|
@ -190,23 +190,23 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
||||||
,
|
,
|
||||||
[ActSeeSocTmlGbl] =
|
[ActSeeSocTmlGbl] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Show timeline (global)" // Necessita traducció
|
"Show timeline global" // Necessita traducció
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
"Show timeline (global)" // Need Übersetzung
|
"Show timeline global" // Need Übersetzung
|
||||||
#elif L==3 // en
|
#elif L==3 // en
|
||||||
"Show timeline (global)"
|
"Show timeline global"
|
||||||
#elif L==4 // es
|
#elif L==4 // es
|
||||||
"Mostrar timeline (global)"
|
"Mostrar timeline global"
|
||||||
#elif L==5 // fr
|
#elif L==5 // fr
|
||||||
"Show timeline (global)" // Besoin de traduction
|
"Show timeline global" // Besoin de traduction
|
||||||
#elif L==6 // gn
|
#elif L==6 // gn
|
||||||
"Mostrar timeline (global)" // Okoteve traducción
|
"Mostrar timeline global" // Okoteve traducción
|
||||||
#elif L==7 // it
|
#elif L==7 // it
|
||||||
"Show timeline (global)" // Bisogno di traduzione
|
"Show timeline global" // Bisogno di traduzione
|
||||||
#elif L==8 // pl
|
#elif L==8 // pl
|
||||||
"Show timeline (global)" // Potrzebujesz tlumaczenie
|
"Show timeline global" // Potrzebujesz tlumaczenie
|
||||||
#elif L==9 // pt
|
#elif L==9 // pt
|
||||||
"Show timeline (global)" // Precisa de tradução
|
"Show timeline global" // Precisa de tradução
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActSeeSocPrf] =
|
[ActSeeSocPrf] =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user