Version 20.47: Mar 11, 2021 Database table with action texts removed.

This commit is contained in:
acanas 2021-03-11 13:56:50 +01:00
parent 987cb3ff20
commit 09f503cf06
5 changed files with 448 additions and 514 deletions

View File

@ -17,17 +17,6 @@ CREATE TABLE IF NOT EXISTS IP_prefs (
INDEX(UsrCod),
INDEX(LastChange));
--
-- 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 act_actions (
ActCod INT NOT NULL DEFAULT -1,
Language CHAR(2) NOT NULL,
Obsolete ENUM('N','Y') NOT NULL DEFAULT 'N',
Txt VARCHAR(255) NOT NULL,
UNIQUE INDEX(ActCod,Language),
INDEX(Txt));
--
-- Table act_MFU: stores the recent actions more frequently made by each user
--
CREATE TABLE IF NOT EXISTS act_MFU (

View File

@ -3743,8 +3743,6 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
/**************************** Private prototypes *****************************/
/*****************************************************************************/
static const char *Act_GetActionTextFromDB (long ActCod); // TODO: Remove when database table actions is removed
/*****************************************************************************/
/****************** Get action from permanent action code ********************/
/*****************************************************************************/
@ -3936,48 +3934,12 @@ const char *Act_GetActionText (Act_Action_t Action)
if (Action >= 0 && Action < Act_NUM_ACTIONS)
if (Txt_Actions[Action])
{
if (Txt_Actions[Action][0])
return Txt_Actions[Action];
return Act_GetActionTextFromDB (Act_GetActCod (Action)); // TODO: Remove when database table actions is removed
}
return "?";
}
/*****************************************************************************/
/********************* Get text for action from database *********************/
/*****************************************************************************/
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];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
static char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
/***** Get test for an action from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get text for an action",
"SELECT Txt" // row[0]
" FROM act_actions"
" WHERE ActCod=%ld"
" AND Language='%s'",
ActCod,Lan_STR_LANG_ID[Lan_LANGUAGE_ES]))
{
/***** Get text *****/
row = mysql_fetch_row (mysql_res);
Str_Copy (ActTxt,row[0],sizeof (ActTxt) - 1);
}
else // ActCod-Language not found on database
ActTxt[0] = '\0';
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
return ActTxt;
}
/*****************************************************************************/
/***************** Adjust current action when no user's logged ***************/
/*****************************************************************************/

View File

@ -600,12 +600,16 @@ 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.46 (2021-03-11)"
#define Log_PLATFORM_VERSION "SWAD 20.47 (2021-03-11)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
Version 20.47: Mar 11, 2021 Database table with action texts removed. (307125 lines)
1 change necessary in database:
DROP TABLE IF EXISTS act_actions;
Version 20.46: Mar 11, 2021 All actions translated to English and Spanish. (307184 lines)
Version 20.45.14: Mar 11, 2021 Some actions translated. (307183 lines)
Version 20.45.13: Mar 11, 2021 Some actions translated. (307182 lines)

View File

@ -124,27 +124,6 @@ mysql> DESCRIBE IP_prefs;
"INDEX(UsrCod),"
"INDEX(LastChange))");
/***** Table act_actions *****/
/*
mysql> DESCRIBE act_actions;
+----------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------+------+-----+---------+-------+
| ActCod | int(11) | NO | PRI | -1 | |
| Language | char(2) | NO | PRI | es | |
| Obsolete | enum('N','Y') | NO | | N | |
| Txt | varchar(255) | NO | MUL | NULL | |
+----------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
*/
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',"
"Txt VARCHAR(255) NOT NULL," // Act_MAX_BYTES_ACTION_TXT
"UNIQUE INDEX(ActCod,Language),"
"INDEX(Txt))");
/***** Table act_MFU *****/
/*
mysql> DESCRIBE act_MFU;

File diff suppressed because it is too large Load Diff