Version 20.45.3: Mar 08, 2021 Actions database tables renamed.

This commit is contained in:
acanas 2021-03-08 10:12:10 +01:00
parent 0b763bd132
commit 7144c1765a
6 changed files with 123 additions and 108 deletions

View File

@ -17,10 +17,10 @@ CREATE TABLE IF NOT EXISTS IP_prefs (
INDEX(UsrCod),
INDEX(LastChange));
--
-- Table actions: stores the text that describes each of the actions.
-- Table act_actions: stores the text that describes each of the actions.
-- Each action has a numeric code associated to it that persists over time.
--
CREATE TABLE IF NOT EXISTS actions (
CREATE TABLE IF NOT EXISTS act_actions (
ActCod INT NOT NULL DEFAULT -1,
Language CHAR(2) NOT NULL,
Obsolete ENUM('N','Y') NOT NULL DEFAULT 'N',
@ -28,9 +28,9 @@ CREATE TABLE IF NOT EXISTS actions (
UNIQUE INDEX(ActCod,Language),
INDEX(Txt));
--
-- Table actions_MFU: stores the recent actions more frequently made by each user
-- Table act_MFU: stores the recent actions more frequently made by each user
--
CREATE TABLE IF NOT EXISTS actions_MFU (
CREATE TABLE IF NOT EXISTS act_MFU (
UsrCod INT NOT NULL,
ActCod INT NOT NULL,
Score FLOAT NOT NULL,

View File

@ -110,8 +110,11 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc
/***** Get most frequently used actions *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get most frequently used actions",
"SELECT ActCod FROM actions_MFU"
" WHERE UsrCod=%ld ORDER BY Score DESC,LastClick DESC",
"SELECT ActCod" // row[0]
" FROM act_MFU"
" WHERE UsrCod=%ld"
" ORDER BY Score DESC,"
"LastClick DESC",
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Write list of frequently used actions *****/
@ -152,13 +155,14 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
if (Gbl.Usrs.Me.UsrDat.UsrCod > 0)
{
/***** Get my most frequently used actions *****/
NumActions =
(unsigned) DB_QuerySELECT (&mysql_res,"can not get"
" most frequently used actions",
"SELECT ActCod FROM actions_MFU"
" WHERE UsrCod=%ld"
" ORDER BY LastClick DESC,Score DESC",
Gbl.Usrs.Me.UsrDat.UsrCod);
NumActions = (unsigned)
DB_QuerySELECT (&mysql_res,"can not get the most frequently used actions",
"SELECT ActCod" // row[0]
" FROM act_MFU"
" WHERE UsrCod=%ld"
" ORDER BY LastClick DESC,"
"Score DESC",
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Loop over list of frequently used actions *****/
for (NumAct = 0;
@ -349,9 +353,12 @@ void MFU_UpdateMFUActions (void)
/***** Get current score *****/
if (DB_QuerySELECT (&mysql_res,"can not get score for current action",
"SELECT Score FROM actions_MFU"
" WHERE UsrCod=%ld AND ActCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod,ActCod))
"SELECT Score" // row[0]
" FROM act_MFU"
" WHERE UsrCod=%ld"
" AND ActCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod,
ActCod))
{
row = mysql_fetch_row (mysql_res);
if (sscanf (row[0],"%lf",&Score) != 1)
@ -368,7 +375,7 @@ void MFU_UpdateMFUActions (void)
/***** Update score for the current action *****/
DB_QueryREPLACE ("can not update most frequently used actions",
"REPLACE INTO actions_MFU"
"REPLACE INTO act_MFU"
" (UsrCod,ActCod,Score,LastClick)"
" VALUES"
" (%ld,%ld,'%15lg',NOW())",
@ -376,7 +383,8 @@ void MFU_UpdateMFUActions (void)
/***** Update score for other actions *****/
DB_QueryUPDATE ("can not update most frequently used actions",
"UPDATE actions_MFU SET Score=GREATEST(Score*'%.15lg','%.15lg')"
"UPDATE act_MFU"
" SET Score=GREATEST(Score*'%.15lg','%.15lg')"
" WHERE UsrCod=%ld AND ActCod<>%ld",
MFU_DECREASE_FACTOR,MFU_MIN_SCORE,
Gbl.Usrs.Me.UsrDat.UsrCod,ActCod);

View File

@ -3959,8 +3959,10 @@ static const char *Act_GetActionTextFromDB (long ActCod) // TODO: Remove when da
/***** Get test for an action from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get text for an action",
"SELECT Txt FROM actions"
" WHERE ActCod=%ld AND Language='%s'",
"SELECT Txt" // row[0]
" FROM act_actions"
" WHERE ActCod=%ld"
" AND Language='%s'",
ActCod,Lan_STR_LANG_ID[Lan_LANGUAGE_ES]))
{
/***** Get text *****/

View File

@ -600,13 +600,18 @@ 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.45.2 (2021-03-08)"
#define Log_PLATFORM_VERSION "SWAD 20.45.3 (2021-03-08)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
Version 20.45.2: Mar 08, 2021 Institutions database table renamed. (307156 lines)
Version 20.45.3: Mar 08, 2021 Actions database tables renamed. (307170 lines)
2 changes necessary in database:
RENAME TABLE actions TO act_actions;
RENAME TABLE actions_MFU TO act_MFU;
Version 20.45.2: Mar 08, 2021 Countries database table renamed. (307156 lines)
1 change necessary in database:
RENAME TABLE countries TO cty_countrs;

View File

@ -124,9 +124,9 @@ mysql> DESCRIBE IP_prefs;
"INDEX(UsrCod),"
"INDEX(LastChange))");
/***** Table actions *****/
/***** Table act_actions *****/
/*
mysql> DESCRIBE actions;
mysql> DESCRIBE act_actions;
+----------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------+------+-----+---------+-------+
@ -137,7 +137,7 @@ mysql> DESCRIBE actions;
+----------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS actions ("
DB_CreateTable ("CREATE TABLE IF NOT EXISTS act_actions ("
"ActCod INT NOT NULL DEFAULT -1,"
"Language CHAR(2) NOT NULL,"
"Obsolete ENUM('N','Y') NOT NULL DEFAULT 'N',"
@ -145,9 +145,9 @@ mysql> DESCRIBE actions;
"UNIQUE INDEX(ActCod,Language),"
"INDEX(Txt))");
/***** Table actions_MFU *****/
/***** Table act_MFU *****/
/*
mysql> DESCRIBE actions_MFU;
mysql> DESCRIBE act_MFU;
+-----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+----------+------+-----+---------+-------+
@ -158,7 +158,7 @@ mysql> DESCRIBE actions_MFU;
+-----------+----------+------+-----+---------+-------+
4 rows in set (0.01 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS actions_MFU ("
DB_CreateTable ("CREATE TABLE IF NOT EXISTS act_MFU ("
"UsrCod INT NOT NULL,"
"ActCod INT NOT NULL,"
"Score FLOAT NOT NULL,"

View File

@ -1555,23 +1555,23 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
,
[ActSeeCty] =
#if L==1 // ca
"" // Necessita traducció
"List countries" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"List countries" // Need Übersetzung
#elif L==3 // en
"List countries"
#elif L==4 // es
""
"Listar pa&iacute;ses"
#elif L==5 // fr
"" // Besoin de traduction
"List countries" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Listar pa&iacute;ses" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"List countries" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"List countries" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"List countries" // Precisa de tradução
#endif
,
[ActSeePen] =
@ -1597,44 +1597,44 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
,
[ActSeeLnk] =
#if L==1 // ca
"" // Necessita traducció
"See institutional links" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"See institutional links" // Need Übersetzung
#elif L==3 // en
"See institutional links"
#elif L==4 // es
""
"Ver enlaces institucionales"
#elif L==5 // fr
"" // Besoin de traduction
"See institutional links" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Ver enlaces institucionales" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"See institutional links" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"See institutional links" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"See institutional links" // Precisa de tradução
#endif
,
[ActLstPlg] =
#if L==1 // ca
"" // Necessita traducció
"List plugins" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"List plugins" // Need Übersetzung
#elif L==3 // en
"List plugins"
#elif L==4 // es
""
"Listar complementos"
#elif L==5 // fr
"" // Besoin de traduction
"List plugins" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Listar complementos" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"List plugins" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"List plugins" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"List plugins" // Precisa de tradução
#endif
,
[ActMtn] =
@ -1660,149 +1660,149 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
,
[ActPrnSysInf] =
#if L==1 // ca
"" // Necessita traducció
"Print information on the platform" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"Print information on the platform" // Need Übersetzung
#elif L==3 // en
"Print information on the platform"
#elif L==4 // es
"Imprimir informaci&oacute;n sobre la plataforma"
#elif L==5 // fr
"" // Besoin de traduction
"Print information on the platform" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Imprimir informaci&oacute;n sobre la plataforma" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"Print information on the platform" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"Print information on the platform" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"Print information on the platform" // Precisa de tradução
#endif
,
[ActEdiCty] =
#if L==1 // ca
"" // Necessita traducció
"Edit countries" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"Edit countries" // Need Übersetzung
#elif L==3 // en
"Edit countries"
#elif L==4 // es
""
"Editar pa&iacute;ses"
#elif L==5 // fr
"" // Besoin de traduction
"Edit countries" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Editar pa&iacute;ses" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"Edit countries" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"Edit countries" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"Edit countries" // Precisa de tradução
#endif
,
[ActNewCty] =
#if L==1 // ca
"" // Necessita traducció
"Request the creation of a country" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"Request the creation of a country" // Need Übersetzung
#elif L==3 // en
"Request the creation of a country"
#elif L==4 // es
""
"Solicitar la creaci&oacute;n de un pa&iacute;s"
#elif L==5 // fr
"" // Besoin de traduction
"Request the creation of a country" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Solicitar la creaci&oacute;n de un pa&iacute;s" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"Request the creation of a country" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"Request the creation of a country" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"Request the creation of a country" // Precisa de tradução
#endif
,
[ActRemCty] =
#if L==1 // ca
"" // Necessita traducció
"Remove a country" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"Remove a country" // Need Übersetzung
#elif L==3 // en
"Remove a country"
#elif L==4 // es
""
"Eliminar un pa&iacute;s"
#elif L==5 // fr
"" // Besoin de traduction
"Remove a country" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Eliminar un pa&iacute;s" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"Remove a country" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"Remove a country" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"Remove a country" // Precisa de tradução
#endif
,
[ActRenCty] =
#if L==1 // ca
"" // Necessita traducció
"Change the name of a country" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"Change the name of a country" // Need Übersetzung
#elif L==3 // en
"Change the name of a country"
#elif L==4 // es
""
"Cambiar el nombre de un pa&iacute;s"
#elif L==5 // fr
"" // Besoin de traduction
"Change the name of a country" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Cambiar el nombre de un pa&iacute;s" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"Change the name of a country" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"Change the name of a country" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"Change the name of a country" // Precisa de tradução
#endif
,
[ActChgCtyWWW] =
#if L==1 // ca
"" // Necessita traducció
"Change the web of country" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"Change the web of country" // Need Übersetzung
#elif L==3 // en
"Change web of country"
"Change the web of country"
#elif L==4 // es
""
"Cambiar la web de un pa&iacute;s"
#elif L==5 // fr
"" // Besoin de traduction
"Change the web of country" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Cambiar la web de un pa&iacute;s" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"Change the web of country" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"Change the web of country" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"Change the web of country" // Precisa de tradução
#endif
,
[ActSeeBan] =
#if L==1 // ca
"" // Necessita traducció
"See banners" // Necessita traducció
#elif L==2 // de
"" // Need Übersetzung
"See banners" // Need Übersetzung
#elif L==3 // en
"See banners"
#elif L==4 // es
""
"Ver banners"
#elif L==5 // fr
"" // Besoin de traduction
"See banners" // Besoin de traduction
#elif L==6 // gn
"" // Okoteve traducción
"Ver banners" // Okoteve traducción
#elif L==7 // it
"" // Bisogno di traduzione
"See banners" // Bisogno di traduzione
#elif L==8 // pl
"" // Potrzebujesz tlumaczenie
"See banners" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"" // Precisa de tradução
"See banners" // Precisa de tradução
#endif
,
[ActEdiBan] =