mirror of https://github.com/acanas/swad-core.git
Version19.109.4
This commit is contained in:
parent
6c13f4dd8a
commit
c9c91afb45
|
@ -5169,18 +5169,38 @@ const char *Act_GetSubtitleAction (Act_Action_t Action)
|
|||
/********************* Get text for action from database *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
char *Act_GetActionTextFromDB (long ActCod,
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1])
|
||||
const char *Act_GetActionText (Act_Action_t Action)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
|
||||
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 *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
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 FROM actions"
|
||||
" WHERE ActCod=%ld AND Language='%s'",
|
||||
ActCod,Lan_STR_LANG_ID[Lan_LANGUAGE_ES])) // !!! TODO: Replace Lan_LANGUAGE_ES by Gbl.Prefs.Language !!!
|
||||
ActCod,Lan_STR_LANG_ID[Lan_LANGUAGE_ES]))
|
||||
{
|
||||
/***** Get text *****/
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
|
|
@ -1698,8 +1698,8 @@ const char *Act_GetIcon (Act_Action_t Action);
|
|||
|
||||
const char *Act_GetTitleAction (Act_Action_t Action);
|
||||
const char *Act_GetSubtitleAction (Act_Action_t Action);
|
||||
char *Act_GetActionTextFromDB (long ActCod,
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]);
|
||||
const char *Act_GetActionText (Act_Action_t Action);
|
||||
const char *Act_GetActionTextFromDB (long ActCod);
|
||||
|
||||
void Act_AdjustActionWhenNoUsrLogged (void);
|
||||
void Act_AdjustCurrentAction (void);
|
||||
|
|
|
@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.109.3 (2020-01-02)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.109.4 (2020-01-02)"
|
||||
#define CSS_FILE "swad19.101.5.css"
|
||||
#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 institution information. (? 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.2: Jan 02, 2020 Changing action descriptions from database to swad-core. Not finished. (278623 lines)
|
||||
Version 19.109.1: Jan 01, 2020 Changing action descriptions from database to swad-core. Not finished. (278680 lines)
|
||||
|
|
|
@ -966,9 +966,7 @@ void Cty_WriteSelectorOfCountry (void)
|
|||
|
||||
void Cty_WriteCountryName (long CtyCod,const char *ClassLink)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
char CtyName[Cty_MAX_BYTES_NAME + 1];
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
bool PutForm = ClassLink &&
|
||||
!Gbl.Form.Inside && // Only if not inside another form
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB; // Only in main browser tab
|
||||
|
@ -981,16 +979,7 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink)
|
|||
/***** Write country name with link to country information *****/
|
||||
Frm_StartForm (ActSeeCtyInf);
|
||||
Cty_PutParamCtyCod (CtyCod);
|
||||
if (Txt_Actions[ActSeeCtyInf])
|
||||
{
|
||||
if (Txt_Actions[ActSeeCtyInf][0])
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeCtyInf],ClassLink,NULL);
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt),
|
||||
ClassLink,NULL);
|
||||
}
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin ("?",ClassLink,NULL);
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionText (ActSeeCtyInf),ClassLink,NULL);
|
||||
HTM_Txt (CtyName);
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
|
|
@ -143,7 +143,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
|
||||
extern const char *Txt_My_courses;
|
||||
extern const char *Txt_System;
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
struct Country Cty;
|
||||
struct Instit Ins;
|
||||
struct Centre Ctr;
|
||||
|
@ -167,7 +166,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
unsigned NumDegs;
|
||||
unsigned NumCrs;
|
||||
unsigned NumCrss;
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
const char *ClassNormal;
|
||||
char ClassHighlight[64];
|
||||
|
||||
|
@ -220,24 +218,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
|
||||
Frm_StartForm (ActMyCrs);
|
||||
Cty_PutParamCtyCod (Cty.CtyCod);
|
||||
if (Txt_Actions[ActSeeCtyInf])
|
||||
{
|
||||
if (Txt_Actions[ActSeeCtyInf][0])
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeCtyInf],
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin ("?",
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionText (ActSeeCtyInf),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
Cty_DrawCountryMap (&Cty,"ICO16x16");
|
||||
HTM_TxtF (" %s",Cty.Name[Gbl.Prefs.Language]);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -268,24 +252,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
||||
Frm_StartForm (ActMyCrs);
|
||||
Ins_PutParamInsCod (Ins.InsCod);
|
||||
if (Txt_Actions[ActSeeInsInf])
|
||||
{
|
||||
if (Txt_Actions[ActSeeInsInf][0])
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeInsInf],
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeInsInf),ActTxt),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin ("?",
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionText (ActSeeInsInf),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
Lgo_DrawLogo (Hie_INS,Ins.InsCod,Ins.ShrtName,16,NULL,true);
|
||||
HTM_TxtF (" %s",Ins.ShrtName);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -316,24 +286,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
|
||||
Frm_StartForm (ActMyCrs);
|
||||
Ctr_PutParamCtrCod (Ctr.CtrCod);
|
||||
if (Txt_Actions[ActSeeCtrInf])
|
||||
{
|
||||
if (Txt_Actions[ActSeeCtrInf][0])
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeCtrInf],
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtrInf),ActTxt),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin ("?",
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionText (ActSeeCtrInf),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
Lgo_DrawLogo (Hie_CTR,Ctr.CtrCod,Ctr.ShrtName,16,NULL,true);
|
||||
HTM_TxtF (" %s",Ctr.ShrtName);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -364,24 +320,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
|
||||
Frm_StartForm (ActMyCrs);
|
||||
Deg_PutParamDegCod (Deg.DegCod);
|
||||
if (Txt_Actions[ActSeeDegInf])
|
||||
{
|
||||
if (Txt_Actions[ActSeeDegInf][0])
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Actions[ActSeeDegInf],
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (ActSeeDegInf),ActTxt),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin ("?",
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionText (ActSeeDegInf),
|
||||
Highlight ? ClassHighlight :
|
||||
ClassNormal,
|
||||
NULL);
|
||||
Lgo_DrawLogo (Hie_DEG,Deg.DegCod,Deg.ShrtName,16,NULL,true);
|
||||
HTM_TxtF (" %s",Deg.ShrtName);
|
||||
HTM_BUTTON_End ();
|
||||
|
|
15
swad_forum.c
15
swad_forum.c
|
@ -2014,10 +2014,8 @@ static void For_WriteLinkToForum (struct Forum *Forum,
|
|||
extern const char *The_ClassFormLinkInBox[The_NUM_THEMES];
|
||||
extern const char *The_ClassFormLinkInBoxBold[The_NUM_THEMES];
|
||||
extern const char *Txt_Copy_not_allowed;
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
unsigned NumThrs;
|
||||
unsigned NumThrsWithNewPosts;
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
const char *Class;
|
||||
char ForumName[For_MAX_BYTES_FORUM_NAME + 1];
|
||||
|
||||
|
@ -2067,17 +2065,8 @@ static void For_WriteLinkToForum (struct Forum *Forum,
|
|||
-1L,
|
||||
-1L);
|
||||
|
||||
if (Txt_Actions[For_ActionsSeeFor[Forum->Type]])
|
||||
{
|
||||
if (Txt_Actions[For_ActionsSeeFor[Forum->Type]][0])
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_Actions[For_ActionsSeeFor[Forum->Type]],
|
||||
Class,NULL);
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionTextFromDB (Act_GetActCod (For_ActionsSeeFor[Forum->Type]),ActTxt),
|
||||
Class,NULL);
|
||||
}
|
||||
else
|
||||
HTM_BUTTON_SUBMIT_Begin ("?",Class,NULL);
|
||||
HTM_BUTTON_SUBMIT_Begin (Act_GetActionText (For_ActionsSeeFor[Forum->Type]),
|
||||
Class,NULL);
|
||||
For_SetForumName (Forum,ForumName,Gbl.Prefs.Language,true);
|
||||
switch (Forum->Type)
|
||||
{
|
||||
|
|
|
@ -767,7 +767,6 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report)
|
|||
extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD];
|
||||
extern const char *Txt_Hits_per_action;
|
||||
extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
extern const char *Txt_Other_actions;
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
|
@ -776,7 +775,6 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report)
|
|||
long ActCod;
|
||||
Act_Action_t Action;
|
||||
Tab_Tab_t Tab;
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
unsigned long NumClicks;
|
||||
|
||||
/***** Start section *****/
|
||||
|
@ -828,15 +826,7 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report)
|
|||
fprintf (Gbl.F.Rep,"%s > ",Txt_TABS_TXT[Tab]);
|
||||
}
|
||||
|
||||
if (Txt_Actions[Action])
|
||||
{
|
||||
if (Txt_Actions[Action][0])
|
||||
fprintf (Gbl.F.Rep,"%s",Txt_Actions[Action]);
|
||||
else
|
||||
fprintf (Gbl.F.Rep,"%s",Act_GetActionTextFromDB (ActCod,ActTxt));
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Rep,"?");
|
||||
fprintf (Gbl.F.Rep,"%s",Act_GetActionText (Action));
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Rep,"?");
|
||||
|
|
|
@ -590,11 +590,9 @@ static void Sta_WriteSelectorAction (void)
|
|||
extern const char *Txt_Action;
|
||||
extern const char *Txt_Any_action;
|
||||
extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
Act_Action_t Action;
|
||||
unsigned ActionUnsigned;
|
||||
Tab_Tab_t Tab;
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
|
||||
/***** Action *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
@ -613,26 +611,10 @@ static void Sta_WriteSelectorAction (void)
|
|||
{
|
||||
Tab = Act_GetTab (Act_GetSuperAction (Action));
|
||||
ActionUnsigned = (unsigned) Action;
|
||||
|
||||
if (Txt_Actions[Action])
|
||||
{
|
||||
if (Txt_Actions[Action][0])
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
|
||||
Action == Gbl.Stat.NumAction,false,
|
||||
"%u: %s > %s",
|
||||
(unsigned) Action,Txt_TABS_TXT[Tab],Txt_Actions[Action]);
|
||||
else
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
|
||||
Action == Gbl.Stat.NumAction,false,
|
||||
"%u: %s > %s",
|
||||
(unsigned) Action,Txt_TABS_TXT[Tab],
|
||||
Act_GetActionTextFromDB (Act_GetActCod (Action),ActTxt));
|
||||
}
|
||||
else
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
|
||||
Action == Gbl.Stat.NumAction,false,
|
||||
"%u: %s > %s",
|
||||
(unsigned) Action,Txt_TABS_TXT[Tab],"?????????????");
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
|
||||
Action == Gbl.Stat.NumAction,false,
|
||||
"%u: %s > %s",
|
||||
(unsigned) Action,Txt_TABS_TXT[Tab],Act_GetActionText (Action));
|
||||
}
|
||||
HTM_SELECT_End ();
|
||||
HTM_TD_End ();
|
||||
|
@ -1441,7 +1423,6 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
|
|||
extern const char *Txt_Action;
|
||||
extern const char *Txt_LOG_More_info;
|
||||
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
unsigned long NumRow;
|
||||
unsigned long FirstRow; // First row to show
|
||||
unsigned long LastRow; // Last rows to show
|
||||
|
@ -1455,8 +1436,6 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
|
|||
unsigned UniqueId;
|
||||
char *Id;
|
||||
long ActCod;
|
||||
Act_Action_t Action;
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
|
||||
/***** Initialize estructura of data of the user *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
@ -1640,22 +1619,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
|
|||
Lay_ShowErrorAndExit ("Wrong action code.");
|
||||
HTM_TD_Begin ("class=\"LOG LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
if (ActCod >= 0)
|
||||
{
|
||||
if ((Action = Act_FromActCodToAction[ActCod]) >= 0)
|
||||
{
|
||||
if (Txt_Actions[Action])
|
||||
{
|
||||
if (Txt_Actions[Action][0])
|
||||
HTM_TxtF ("%s ",Txt_Actions[Action]);
|
||||
else
|
||||
HTM_TxtF ("%s ",Act_GetActionTextFromDB (ActCod,ActTxt));
|
||||
}
|
||||
else
|
||||
HTM_TxtF ("? ");
|
||||
}
|
||||
else
|
||||
HTM_TxtF ("? ");
|
||||
}
|
||||
HTM_TxtF ("%s ",Act_GetActionText (Act_FromActCodToAction[ActCod]));
|
||||
else
|
||||
HTM_TxtF ("? ");
|
||||
HTM_TD_End ();
|
||||
|
@ -3021,13 +2985,10 @@ static void Sta_ShowNumHitsPerAction (unsigned long NumRows,
|
|||
extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD];
|
||||
extern const char *Txt_Action;
|
||||
extern const char *Txt_STAT_TYPE_COUNT_CAPS[Sta_NUM_COUNT_TYPES];
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
unsigned long NumRow;
|
||||
struct Sta_Hits Hits;
|
||||
MYSQL_ROW row;
|
||||
long ActCod;
|
||||
Act_Action_t Action;
|
||||
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
|
||||
|
||||
/***** Write heading *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
@ -3055,22 +3016,7 @@ static void Sta_ShowNumHitsPerAction (unsigned long NumRows,
|
|||
|
||||
HTM_TD_Begin ("class=\"LOG RT\"");
|
||||
if (ActCod >= 0)
|
||||
{
|
||||
if ((Action = Act_FromActCodToAction[ActCod]) >= 0)
|
||||
{
|
||||
if (Txt_Actions[Action])
|
||||
{
|
||||
if (Txt_Actions[Action][0])
|
||||
HTM_TxtF ("%s ",Txt_Actions[Action]);
|
||||
else
|
||||
HTM_TxtF ("%s ",Act_GetActionTextFromDB (ActCod,ActTxt));
|
||||
}
|
||||
else
|
||||
HTM_Txt ("? ");
|
||||
}
|
||||
else
|
||||
HTM_Txt ("? ");
|
||||
}
|
||||
HTM_TxtF ("%s ",Act_GetActionText (Act_FromActCodToAction[ActCod]));
|
||||
else
|
||||
HTM_Txt ("? ");
|
||||
HTM_TD_End ();
|
||||
|
|
Loading…
Reference in New Issue